labwc/meson.build
Johan Malm e5f60ce8a7 ci: use -Wno-expansion-to-defined to avoid Arch CI error
...with this warning message:

[100/161] Compiling C object labwc.p/src_button_button-svg.c.o
FAILED: labwc.p/src_button_button-svg.c.o
gcc -Ilabwc.p -I. -I.. -Iinclude -I../include -I/usr/include/wlroots-0.18 -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/lib/pkgconfig/../../include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O0 -g -DWLR_USE_UNSTABLE -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough=2 -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wunused-macros -Wno-unused-parameter '-DLABWC_VERSION="0.8.0"' '-DGETTEXT_PACKAGE="labwc"' '-DLOCALEDIR="/usr/local/share/locale"' -pthread -MD -MQ labwc.p/src_button_button-svg.c.o -MF labwc.p/src_button_button-svg.c.o.d -o labwc.p/src_button_button-svg.c.o -c ../src/button/button-svg.c
In file included from ../src/button/button-svg.c:7:
/usr/lib/pkgconfig/../../include/librsvg-2.0/librsvg/rsvg.h:1331:1: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
 1331 | #if LIBRSVG_CHECK_FEATURE(PIXBUF)
      | ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
2024-09-24 07:15:13 +09:00

153 lines
3.5 KiB
Meson

project(
'labwc',
'c',
version: '0.8.0',
license: 'GPL-2.0-only',
meson_version: '>=0.59.0',
default_options: [
'c_std=c11',
'warning_level=2',
],
)
add_project_arguments(
[
'-DWLR_USE_UNSTABLE',
],
language: 'c',
)
cc = meson.get_compiler('c')
add_project_arguments(cc.get_supported_arguments([
'-Wundef',
'-Wlogical-op',
'-Wmissing-include-dirs',
'-Wold-style-definition',
'-Wpointer-arith',
'-Winit-self',
'-Wstrict-prototypes',
'-Wimplicit-fallthrough=2',
'-Wendif-labels',
'-Wstrict-aliasing=2',
'-Woverflow',
'-Wmissing-prototypes',
'-Walloca',
'-Wunused-macros',
'-Wno-unused-parameter',
'-Wno-expansion-to-defined',
]), language: 'c')
version='"@0@"'.format(meson.project_version())
git = find_program('git', native: true, required: false)
if git.found()
git_commit = run_command([git, 'describe', '--dirty'], check: false)
if git_commit.returncode() == 0
version = '"@0@"'.format(git_commit.stdout().strip())
endif
endif
add_project_arguments('-DLABWC_VERSION=@0@'.format(version), language: 'c')
wlroots = dependency(
'wlroots-0.18',
default_options: ['default_library=static', 'examples=false'],
version: ['>=0.18.0', '<0.19.0'],
)
wlroots_has_xwayland = wlroots.get_variable('have_xwayland') == 'true'
wayland_server = dependency('wayland-server', version: '>=1.19.0')
wayland_protos = dependency('wayland-protocols', version: '>=1.35')
xkbcommon = dependency('xkbcommon')
xcb = dependency('xcb', required: get_option('xwayland'))
xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland'))
drm_full = dependency('libdrm')
drm = drm_full.partial_dependency(compile_args: true, includes: true)
xml2 = dependency('libxml-2.0')
glib = dependency('glib-2.0')
cairo = dependency('cairo')
pangocairo = dependency('pangocairo')
input = dependency('libinput', version: '>=1.14')
pixman = dependency('pixman-1')
math = cc.find_library('m')
png = dependency('libpng')
svg = dependency('librsvg-2.0', version: '>=2.46', required: false)
if get_option('xwayland').enabled() and not wlroots_has_xwayland
error('no wlroots Xwayland support')
endif
have_xwayland = xcb.found() and wlroots_has_xwayland
conf_data = configuration_data()
conf_data.set10('HAVE_XWAYLAND', have_xwayland)
if get_option('svg').disabled()
have_rsvg = false
else
have_rsvg = svg.found()
endif
conf_data.set10('HAVE_RSVG', have_rsvg)
if get_option('static_analyzer').enabled()
add_project_arguments(['-fanalyzer'], language: 'c')
endif
msgfmt = find_program('msgfmt', required: get_option('nls'))
if msgfmt.found()
source_root = meson.current_source_dir()
conf_data.set('HAVE_NLS', 1)
subdir('po')
else
conf_data.set('HAVE_NLS', 0)
endif
labwc_inc = include_directories('include')
subdir('protocols')
labwc_deps = [
server_protos,
wayland_server,
wlroots,
xkbcommon,
xcb_icccm,
xml2,
glib,
cairo,
drm,
pangocairo,
input,
pixman,
math,
png,
]
if have_rsvg
labwc_deps += [
svg,
]
endif
subdir('include')
subdir('src')
subdir('docs')
dep_cmocka = dependency('cmocka', required: get_option('test'))
if dep_cmocka.found()
subdir('t')
endif
executable(
meson.project_name(),
labwc_sources,
include_directories: [labwc_inc],
dependencies: labwc_deps,
install: true,
)
install_data('data/labwc.desktop', install_dir: get_option('datadir') / 'wayland-sessions')
icons = ['labwc-symbolic.svg', 'labwc.svg']
foreach icon : icons
icon_path = join_paths('data', icon)
install_data(icon_path, install_dir: get_option('datadir') / 'icons/hicolor/scalable/apps')
endforeach