diff --git a/data/meson.build b/data/meson.build index d3004253c7b..4f4e659f168 100644 --- a/data/meson.build +++ b/data/meson.build @@ -11,17 +11,17 @@ subdir('metainfo') # desktop_conf = configuration_data() desktop_conf.set('application_id', application_id) -desktop_file = i18n.merge_file('desktop', - input: configure_file( - input: files('ca.andyholmes.Valent.desktop.in.in'), - output: 'ca.andyholmes.Valent.desktop.in', - configuration: desktop_conf - ), - output: '@0@.desktop'.format(application_id), - install: true, +desktop_file = i18n.merge_file( + input: configure_file( + input: files('ca.andyholmes.Valent.desktop.in.in'), + output: 'ca.andyholmes.Valent.desktop.in', + configuration: desktop_conf + ), + output: '@0@.desktop'.format(application_id), + install: true, install_dir: join_paths(datadir, 'applications'), - po_dir: po_dir, - type: 'desktop' + po_dir: po_dir, + type: 'desktop' ) desktop_utils = find_program('desktop-file-validate', required: false) @@ -38,15 +38,13 @@ endif # Application Icon # scalable_icondir = join_paths('icons', 'hicolor', 'scalable', 'apps') -install_data( - join_paths(scalable_icondir, '@0@.svg'.format(application_id)), +install_data(join_paths(scalable_icondir, '@0@.svg'.format(application_id)), install_dir: join_paths(datadir, scalable_icondir), rename: '@0@.svg'.format(application_id), ) symbolic_icondir = join_paths('icons', 'hicolor', 'symbolic', 'apps') -install_data( - join_paths(symbolic_icondir, 'ca.andyholmes.Valent-symbolic.svg'), +install_data(join_paths(symbolic_icondir, 'ca.andyholmes.Valent-symbolic.svg'), install_dir: join_paths(datadir, symbolic_icondir), rename: '@0@-symbolic.svg'.format(application_id), ) diff --git a/data/metainfo/meson.build b/data/metainfo/meson.build index 7077bc34208..4ce1e8554fb 100644 --- a/data/metainfo/meson.build +++ b/data/metainfo/meson.build @@ -7,16 +7,16 @@ metainfo_conf = configuration_data() metainfo_conf.set('application_id', application_id) metainfo_conf.set('gettext_package', meson.project_name()) -metainfo_file = i18n.merge_file('metainfo', - input: configure_file( - input: files('ca.andyholmes.Valent.metainfo.xml.in.in'), - output: 'ca.andyholmes.Valent.metainfo.xml.in', - configuration: metainfo_conf, - ), - output: '@0@.metainfo.xml'.format(application_id), - install: true, +metainfo_file = i18n.merge_file( + input: configure_file( + input: files('ca.andyholmes.Valent.metainfo.xml.in.in'), + output: 'ca.andyholmes.Valent.metainfo.xml.in', + configuration: metainfo_conf, + ), + output: '@0@.metainfo.xml'.format(application_id), + install: true, install_dir: join_paths(datadir, 'metainfo'), - po_dir: po_dir, + po_dir: po_dir, ) appstream_util = find_program('appstream-util', required: false) diff --git a/doc/sdk/meson.build b/doc/sdk/meson.build index 35c316bb998..2f8e63bf4f4 100644 --- a/doc/sdk/meson.build +++ b/doc/sdk/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # SPDX-FileCopyrightText: 2021 Andy Holmes -libvalent_build = join_paths(meson.build_root(), 'src', 'libvalent') +libvalent_build = join_paths(meson.project_build_root(), 'src', 'libvalent') # Get gi-docgen gidocgen_dep = dependency('gi-docgen', @@ -25,7 +25,7 @@ valent_toml = configure_file( # Protocol Docs protocol_py = find_program('protocol.py') protocol_doc = custom_target('protocol-doc', - input: join_paths(meson.source_root(), 'doc', 'schemas', 'index.json'), + input: join_paths(meson.project_source_root(), 'doc', 'schemas', 'index.json'), output: 'protocol.md', command: [ protocol_py, diff --git a/meson.build b/meson.build index 108665339b3..9d4e5e5ddb0 100644 --- a/meson.build +++ b/meson.build @@ -4,7 +4,7 @@ project('valent', 'c', license: 'GPL-3.0-or-later', version: '0.1.0', - meson_version: '>= 0.53.0', + meson_version: '>= 0.56.0', default_options: [ 'buildtype=debugoptimized', 'warning_level=2', @@ -37,11 +37,9 @@ profile = get_option('profile') if profile == 'devel' application_id = 'ca.andyholmes.Valent.Devel' application_path = '/ca/andyholmes/Valent/Devel' - profile_suffix = ' (Devel)' else application_id = 'ca.andyholmes.Valent' application_path = '/ca/andyholmes/Valent' - profile_suffix = '' endif @@ -67,7 +65,7 @@ pkglibdir = join_paths(libdir, meson.project_name()) pkglibexecdir = join_paths(libexecdir, meson.project_name()) pkgpluginsdir = join_paths(pkglibdir, 'plugins') -po_dir = join_paths(meson.source_root(), 'po') +po_dir = join_paths(meson.current_source_dir(), 'po') # @@ -75,13 +73,71 @@ po_dir = join_paths(meson.source_root(), 'po') # cc = meson.get_compiler('c') +release_args = [] +project_c_args = [ + '-Wformat=2', + '-Wincompatible-pointer-types', + '-Wint-conversion', + '-Wint-to-pointer-cast', + '-Wmissing-include-dirs', + '-Woverflow', + '-Wpointer-arith', + '-Wpointer-to-int-cast', + '-Wredundant-decls', + '-Wshadow', + '-Wstrict-prototypes', + '-Wundef', + + '-Wno-discarded-array-qualifiers', + '-Wno-missing-field-initializers', + '-Wno-unused-parameter', + + '-Wno-error=cast-function-type', + # TODO: These should be fixed instead of downgraded to warnings + '-Wno-error=shadow', + '-Wno-error=unused-function', +] +project_link_args = [ + '-Wl,-z,relro', + '-Wl,-z,now', +] + +# Clang doesn't consider cleanup functions as using a variable +if cc.get_id() == 'clang' + project_c_args += ['-Wno-error=unused-but-set-variable'] +endif + +if get_option('buildtype') != 'plain' + project_c_args += ['-fstack-protector-strong'] +endif + +if get_option('debug') + project_c_args += ['-fno-omit-frame-pointer'] +endif + +if get_option('optimization') in ['2', '3', 's'] + project_c_args += ['-DG_DISABLE_CAST_CHECKS'] + project_link_args += ['-Wl,-Bsymbolic'] + + if not get_option('tests') + release_args += ['-DG_DISABLE_ASSERT'] + endif +endif + +add_project_arguments(cc.get_supported_arguments(project_c_args), + language: 'c', +) + +add_project_link_arguments(cc.get_supported_link_arguments(project_link_args), + language: 'c', +) + # # config.h # config_h = configuration_data() config_h_inc = include_directories('.') - config_h_defines = [ # Desktop ['APPLICATION_ID', application_id], @@ -104,7 +160,6 @@ config_h_defines = [ ['PACKAGE_PLUGINSDIR', pkgpluginsdir], ['PROFILE_NAME', profile], - ['PROFILE_SUFFIX', profile_suffix], # i18n ['GETTEXT_PACKAGE', meson.project_name()], @@ -127,17 +182,11 @@ foreach function : config_h_functions endif endforeach - configure_file( output: 'config.h', configuration: config_h, ) -add_project_arguments([ - '-DHAVE_CONFIG_H', - '-DVALENT_COMPILATION', -], language: 'c') - # # Dependencies @@ -178,64 +227,6 @@ if get_option('profiling') endif -# -# Build Type -# -release_args = [] -project_c_args = [ - '-Wformat=2', - '-Wincompatible-pointer-types', - '-Wint-conversion', - '-Wint-to-pointer-cast', - '-Wmissing-include-dirs', - '-Woverflow', - '-Wpointer-arith', - '-Wpointer-to-int-cast', - '-Wredundant-decls', - '-Wshadow', - '-Wstrict-prototypes', - '-Wundef', - - '-Wno-discarded-array-qualifiers', - '-Wno-missing-field-initializers', - '-Wno-unused-parameter', - - '-Wno-error=cast-function-type', - # TODO: These should be fixed instead of downgraded to warnings - '-Wno-error=shadow', - '-Wno-error=unused-function', -] -project_link_args = [ - '-Wl,-z,relro', - '-Wl,-z,now', -] - -if get_option('buildtype') != 'plain' - project_c_args += ['-fstack-protector-strong'] -endif - -if get_option('debug') - project_c_args += ['-fno-omit-frame-pointer'] -endif - -if get_option('optimization') in ['2', '3', 's'] - project_c_args += ['-DG_DISABLE_CAST_CHECKS'] - project_link_args += ['-Wl,-Bsymbolic'] - - if not get_option('tests') - release_args += ['-DG_DISABLE_ASSERT'] - endif -endif - -add_project_arguments(cc.get_supported_arguments(project_c_args), - language: 'c', -) - -add_project_link_arguments(cc.get_supported_link_arguments(project_link_args), - language: 'c', -) - - # # Build # diff --git a/src/libvalent/meson.build b/src/libvalent/meson.build index 69e4314a2f2..3bd1e84f8f0 100644 --- a/src/libvalent/meson.build +++ b/src/libvalent/meson.build @@ -87,16 +87,16 @@ if get_option('introspection') ] libvalent_gir = gnome.generate_gir(libvalent, - sources: libvalent_gir_sources, - namespace: 'Valent', - nsversion: valent_api_version, - symbol_prefix: meson.project_name(), - identifier_prefix: 'Valent', - includes: libvalent_gir_includes, - install: true, - install_dir_gir: girdir, + sources: libvalent_gir_sources, + namespace: 'Valent', + nsversion: valent_api_version, + symbol_prefix: meson.project_name(), + identifier_prefix: 'Valent', + includes: libvalent_gir_includes, + install: true, + install_dir_gir: girdir, install_dir_typelib: typelibdir, - extra_args: libvalent_gir_extra_args, + extra_args: libvalent_gir_extra_args, ) endif diff --git a/src/main.c b/src/main.c index a4b3af020d5..843085d082c 100644 --- a/src/main.c +++ b/src/main.c @@ -14,19 +14,16 @@ main (int argc, { int ret; g_autoptr (ValentApplication) service = NULL; - g_autofree char *application_name = NULL; /* Set up gettext translations */ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - application_name = g_strconcat ("Valent", PROFILE_SUFFIX, NULL); - g_set_application_name (application_name); - /* Start the service */ valent_debug_init (); + g_set_application_name ("Valent"); service = _valent_application_new (); ret = g_application_run (G_APPLICATION (service), argc, argv); diff --git a/src/plugins/battery/meson.build b/src/plugins/battery/meson.build index 4f37c323af1..22a33fdf822 100644 --- a/src/plugins/battery/meson.build +++ b/src/plugins/battery/meson.build @@ -21,7 +21,7 @@ plugin_battery_sources = files([ plugin_battery_include_directories = [include_directories('.')] # Resources -plugin_battery_info = i18n.merge_file('battery.plugin', +plugin_battery_info = i18n.merge_file( input: 'battery.plugin.desktop.in', output: 'battery.plugin', po_dir: po_dir, diff --git a/src/plugins/bluez/meson.build b/src/plugins/bluez/meson.build index fd83bfa737c..62635132a6f 100644 --- a/src/plugins/bluez/meson.build +++ b/src/plugins/bluez/meson.build @@ -21,7 +21,7 @@ plugin_bluez_sources = files([ plugin_bluez_include_directories = [include_directories('.')] # Resources -plugin_bluez_info = i18n.merge_file('bluez.plugin', +plugin_bluez_info = i18n.merge_file( input: 'bluez.plugin.desktop.in', output: 'bluez.plugin', po_dir: po_dir, diff --git a/src/plugins/clipboard/meson.build b/src/plugins/clipboard/meson.build index b22c7231410..24e1407615d 100644 --- a/src/plugins/clipboard/meson.build +++ b/src/plugins/clipboard/meson.build @@ -18,7 +18,7 @@ plugin_clipboard_sources = files([ plugin_clipboard_include_directories = [include_directories('.')] # Resources -plugin_clipboard_info = i18n.merge_file('clipboard.plugin', +plugin_clipboard_info = i18n.merge_file( input: 'clipboard.plugin.desktop.in', output: 'clipboard.plugin', po_dir: po_dir, diff --git a/src/plugins/contacts/meson.build b/src/plugins/contacts/meson.build index 2548d389839..c9b8cfa8e9e 100644 --- a/src/plugins/contacts/meson.build +++ b/src/plugins/contacts/meson.build @@ -18,7 +18,7 @@ plugin_contacts_sources = files([ plugin_contacts_include_directories = [include_directories('.')] # Resources -plugin_contacts_info = i18n.merge_file('contacts.plugin', +plugin_contacts_info = i18n.merge_file( input: 'contacts.plugin.desktop.in', output: 'contacts.plugin', po_dir: po_dir, diff --git a/src/plugins/eds/meson.build b/src/plugins/eds/meson.build index 93c3e1dd123..c658a9defe4 100644 --- a/src/plugins/eds/meson.build +++ b/src/plugins/eds/meson.build @@ -21,7 +21,7 @@ plugin_eds_sources = files([ plugin_eds_include_directories = include_directories('.') # Resources -plugin_eds_info = i18n.merge_file('eds.plugin', +plugin_eds_info = i18n.merge_file( input: 'eds.plugin.desktop.in', output: 'eds.plugin', po_dir: po_dir, diff --git a/src/plugins/fdo/meson.build b/src/plugins/fdo/meson.build index 4cec795788c..1ffb6c05dec 100644 --- a/src/plugins/fdo/meson.build +++ b/src/plugins/fdo/meson.build @@ -28,7 +28,7 @@ plugin_fdo_sources = files([ plugin_fdo_include_directories = [include_directories('.')] # Resources -plugin_fdo_info = i18n.merge_file('fdo.plugin', +plugin_fdo_info = i18n.merge_file( input: 'fdo.plugin.desktop.in', output: 'fdo.plugin', po_dir: po_dir, diff --git a/src/plugins/findmyphone/meson.build b/src/plugins/findmyphone/meson.build index 6c122d5d68c..612ad5d2108 100644 --- a/src/plugins/findmyphone/meson.build +++ b/src/plugins/findmyphone/meson.build @@ -27,7 +27,7 @@ plugin_findmyphone_sources = files([ plugin_findmyphone_include_directories = [include_directories('.')] # Resources -plugin_findmyphone_info = i18n.merge_file('findmyphone.plugin', +plugin_findmyphone_info = i18n.merge_file( input: 'findmyphone.plugin.desktop.in', output: 'findmyphone.plugin', po_dir: po_dir, diff --git a/src/plugins/gtk/meson.build b/src/plugins/gtk/meson.build index ff6a7d5dd4f..5d4e53dccdd 100644 --- a/src/plugins/gtk/meson.build +++ b/src/plugins/gtk/meson.build @@ -20,7 +20,7 @@ plugin_gtk_sources = files([ plugin_gtk_include_directories = [include_directories('.')] # Resources -plugin_gtk_info = i18n.merge_file('gtk.plugin', +plugin_gtk_info = i18n.merge_file( input: 'gtk.plugin.desktop.in', output: 'gtk.plugin', po_dir: po_dir, diff --git a/src/plugins/lan/meson.build b/src/plugins/lan/meson.build index 40cd0017d77..c91a6be7c70 100644 --- a/src/plugins/lan/meson.build +++ b/src/plugins/lan/meson.build @@ -17,7 +17,7 @@ plugin_lan_sources = files([ plugin_lan_include_directories = [include_directories('.')] # Resources -plugin_lan_info = i18n.merge_file('lan.plugin', +plugin_lan_info = i18n.merge_file( input: 'lan.plugin.desktop.in', output: 'lan.plugin', po_dir: po_dir, diff --git a/src/plugins/lock/meson.build b/src/plugins/lock/meson.build index 3bc31559aa2..45db69106c8 100644 --- a/src/plugins/lock/meson.build +++ b/src/plugins/lock/meson.build @@ -16,7 +16,7 @@ plugin_lock_sources = files([ plugin_lock_include_directories = [include_directories('.')] # Resources -plugin_lock_info = i18n.merge_file('lock.plugin', +plugin_lock_info = i18n.merge_file( input: 'lock.plugin.desktop.in', output: 'lock.plugin', po_dir: po_dir, diff --git a/src/plugins/mousepad/meson.build b/src/plugins/mousepad/meson.build index 484e2386a64..941fb913fd0 100644 --- a/src/plugins/mousepad/meson.build +++ b/src/plugins/mousepad/meson.build @@ -18,7 +18,7 @@ plugin_mousepad_sources = files([ plugin_mousepad_include_directories = [include_directories('.')] # Resources -plugin_mousepad_info = i18n.merge_file('mousepad.plugin', +plugin_mousepad_info = i18n.merge_file( input: 'mousepad.plugin.desktop.in', output: 'mousepad.plugin', po_dir: po_dir, diff --git a/src/plugins/mpris/meson.build b/src/plugins/mpris/meson.build index 0c1f7291209..d89e29e6ce0 100644 --- a/src/plugins/mpris/meson.build +++ b/src/plugins/mpris/meson.build @@ -19,7 +19,7 @@ plugin_mpris_sources = files([ plugin_mpris_include_directories = [include_directories('.')] # Resources -plugin_mpris_info = i18n.merge_file('mpris.plugin', +plugin_mpris_info = i18n.merge_file( input: 'mpris.plugin.desktop.in', output: 'mpris.plugin', po_dir: po_dir, diff --git a/src/plugins/notification/meson.build b/src/plugins/notification/meson.build index 448f0f87219..2f852c69653 100644 --- a/src/plugins/notification/meson.build +++ b/src/plugins/notification/meson.build @@ -20,7 +20,7 @@ plugin_notification_sources = files([ plugin_notification_include_directories = [include_directories('.')] # Resources -plugin_notification_info = i18n.merge_file('notification.plugin', +plugin_notification_info = i18n.merge_file( input: 'notification.plugin.desktop.in', output: 'notification.plugin', po_dir: po_dir, diff --git a/src/plugins/photo/meson.build b/src/plugins/photo/meson.build index 07509fe6390..794bee547dc 100644 --- a/src/plugins/photo/meson.build +++ b/src/plugins/photo/meson.build @@ -23,7 +23,7 @@ plugin_photo_sources = files([ plugin_photo_include_directories = [include_directories('.')] # Resources -plugin_photo_info = i18n.merge_file('photo.plugin', +plugin_photo_info = i18n.merge_file( input: 'photo.plugin.desktop.in', output: 'photo.plugin', po_dir: po_dir, diff --git a/src/plugins/ping/meson.build b/src/plugins/ping/meson.build index dcba16f60f1..0d440d367c7 100644 --- a/src/plugins/ping/meson.build +++ b/src/plugins/ping/meson.build @@ -15,7 +15,7 @@ plugin_ping_sources = files([ plugin_ping_include_directories = [include_directories('.')] # Resources -plugin_ping_info = i18n.merge_file('ping.plugin', +plugin_ping_info = i18n.merge_file( input: 'ping.plugin.desktop.in', output: 'ping.plugin', po_dir: po_dir, diff --git a/src/plugins/pulseaudio/meson.build b/src/plugins/pulseaudio/meson.build index 340fb73e382..94f16bb7a15 100644 --- a/src/plugins/pulseaudio/meson.build +++ b/src/plugins/pulseaudio/meson.build @@ -35,7 +35,7 @@ plugin_pulseaudio_sources = files([ plugin_pulseaudio_include_directories = [include_directories('.')] # Resources -plugin_pulseaudio_info = i18n.merge_file('pulseaudio.plugin', +plugin_pulseaudio_info = i18n.merge_file( input: 'pulseaudio.plugin.desktop.in', output: 'pulseaudio.plugin', po_dir: po_dir, diff --git a/src/plugins/runcommand/meson.build b/src/plugins/runcommand/meson.build index 7a773b63a5c..1225f337503 100644 --- a/src/plugins/runcommand/meson.build +++ b/src/plugins/runcommand/meson.build @@ -19,7 +19,7 @@ plugin_runcommand_sources = files([ plugin_runcommand_include_directories = [include_directories('.')] # Resources -plugin_runcommand_info = i18n.merge_file('runcommand.plugin', +plugin_runcommand_info = i18n.merge_file( input: 'runcommand.plugin.desktop.in', output: 'runcommand.plugin', po_dir: po_dir, diff --git a/src/plugins/sftp/meson.build b/src/plugins/sftp/meson.build index 88b37a56d34..3cf6b0cd6c2 100644 --- a/src/plugins/sftp/meson.build +++ b/src/plugins/sftp/meson.build @@ -17,7 +17,7 @@ plugin_sftp_sources = files([ plugin_sftp_include_directories = [include_directories('.')] # Resources -plugin_sftp_info = i18n.merge_file('sftp.plugin', +plugin_sftp_info = i18n.merge_file( input: 'sftp.plugin.desktop.in', output: 'sftp.plugin', po_dir: po_dir, diff --git a/src/plugins/share/meson.build b/src/plugins/share/meson.build index 5047a2e29f7..2370c290588 100644 --- a/src/plugins/share/meson.build +++ b/src/plugins/share/meson.build @@ -16,7 +16,7 @@ plugin_share_sources = files([ plugin_share_include_directories = [include_directories('.')] # Resources -plugin_share_info = i18n.merge_file('share.plugin', +plugin_share_info = i18n.merge_file( input: 'share.plugin.desktop.in', output: 'share.plugin', po_dir: po_dir, diff --git a/src/plugins/sms/meson.build b/src/plugins/sms/meson.build index f6745055b74..9b4079a8fcd 100644 --- a/src/plugins/sms/meson.build +++ b/src/plugins/sms/meson.build @@ -34,7 +34,7 @@ plugin_sms_sources = files([ plugin_sms_include_directories = [include_directories('.')] # Resources -plugin_sms_info = i18n.merge_file('sms.plugin', +plugin_sms_info = i18n.merge_file( input: 'sms.plugin.desktop.in', output: 'sms.plugin', po_dir: po_dir, diff --git a/src/plugins/systemvolume/meson.build b/src/plugins/systemvolume/meson.build index 9f111eafd83..d465419124a 100644 --- a/src/plugins/systemvolume/meson.build +++ b/src/plugins/systemvolume/meson.build @@ -16,7 +16,7 @@ plugin_systemvolume_sources = files([ plugin_systemvolume_include_directories = [include_directories('.')] # Resources -plugin_systemvolume_info = i18n.merge_file('systemvolume.plugin', +plugin_systemvolume_info = i18n.merge_file( input: 'systemvolume.plugin.desktop.in', output: 'systemvolume.plugin', po_dir: po_dir, diff --git a/src/plugins/telephony/meson.build b/src/plugins/telephony/meson.build index b0a7338c3ad..55b68c8dbb0 100644 --- a/src/plugins/telephony/meson.build +++ b/src/plugins/telephony/meson.build @@ -18,7 +18,7 @@ plugin_telephony_sources = files([ plugin_telephony_include_directories = [include_directories('.')] # Resources -plugin_telephony_info = i18n.merge_file('telephony.plugin', +plugin_telephony_info = i18n.merge_file( input: 'telephony.plugin.desktop.in', output: 'telephony.plugin', po_dir: po_dir, diff --git a/src/plugins/xdp/meson.build b/src/plugins/xdp/meson.build index 65a9db52789..9818061a858 100644 --- a/src/plugins/xdp/meson.build +++ b/src/plugins/xdp/meson.build @@ -26,7 +26,7 @@ plugin_xdp_sources = files([ plugin_xdp_include_directories = [include_directories('.')] # Resources -plugin_xdp_info = i18n.merge_file('xdp.plugin', +plugin_xdp_info = i18n.merge_file( input: 'xdp.plugin.desktop.in', output: 'xdp.plugin', po_dir: po_dir, diff --git a/src/tests/meson.build b/src/tests/meson.build index 6b849bcd3f0..2ca677bdc8a 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -2,10 +2,10 @@ # SPDX-FileCopyrightText: 2021 Andy Holmes # Test Environment -libpeas_libdir = libpeas_dep.get_pkgconfig_variable('libdir') +libpeas_libdir = libpeas_dep.get_variable('libdir') typelib_dirs = [ - '@0@/src/libvalent'.format(meson.build_root()), + '@0@/src/libvalent'.format(meson.project_build_root()), join_paths(libpeas_libdir, 'girepository-1.0'), ] @@ -16,7 +16,7 @@ tests_env = [ 'G_DEBUG=gc-friendly', 'G_SLICE=always-malloc', 'GSETTINGS_BACKEND=memory', - 'GSETTINGS_SCHEMA_DIR=@0@/schemas'.format(meson.build_root()), + 'GSETTINGS_SCHEMA_DIR=@0@/schemas'.format(meson.project_build_root()), 'PYTHONDONTWRITEBYTECODE=yes', 'MALLOC_CHECK_=2', 'GDK_BACKEND=wayland,x11', @@ -32,8 +32,9 @@ tests_env = [ test_c_args = [ '-DTEST_DATA_DIR="@0@/data/"'.format(meson.current_source_dir()), - '-DJSON_SCHEMA_DIR="@0@"'.format(join_paths(meson.source_root(), 'doc', 'schemas')), - '-I' + join_paths(meson.source_root(), 'src'), + '-DJSON_SCHEMA_DIR="@0@"'.format( + join_paths(meson.project_source_root(), 'doc', 'schemas')), + '-I' + join_paths(meson.project_source_root(), 'src'), ] test_link_args = [ @@ -49,7 +50,7 @@ run_command(gsettings_test_init, ) compile_schemas = find_program('glib-compile-schemas') -test_schema_dir = join_paths(meson.build_root(), 'schemas') +test_schema_dir = join_paths(meson.project_build_root(), 'schemas') test('Validate GSchema files', compile_schemas, args: ['--strict', '--dry-run', test_schema_dir],