From d085c7f5858ee63d5b9b7ec74bb4796bc7b26839 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 6 Jul 2020 10:59:45 +0100 Subject: [PATCH] build: Use meson.current_source_dir() instead of source_root() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The latter doesn’t work well when building as a subproject — it explicitly refers to the parent project root. Signed-off-by: Philip Withnall --- libmalcontent-ui/meson.build | 2 +- libmalcontent/tests/meson.build | 4 ++-- malcontent-control/meson.build | 8 ++++---- meson.build | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libmalcontent-ui/meson.build b/libmalcontent-ui/meson.build index 38601f3..b4e70c7 100644 --- a/libmalcontent-ui/meson.build +++ b/libmalcontent-ui/meson.build @@ -8,7 +8,7 @@ endif resources = gnome.compile_resources( 'resources', 'malcontent-ui.gresource.xml', - source_dir: meson.source_root(), + source_dir: meson.current_source_dir(), ) libmalcontent_ui_sources = [ diff --git a/libmalcontent/tests/meson.build b/libmalcontent/tests/meson.build index 630b3dd..27b67e1 100644 --- a/libmalcontent/tests/meson.build +++ b/libmalcontent/tests/meson.build @@ -34,8 +34,8 @@ accounts_service_iface_c = custom_target( ) accounts_service_extension_ifaces = [ - join_paths(meson.source_root(), 'accounts-service', 'com.endlessm.ParentalControls.AppFilter.xml'), - join_paths(meson.source_root(), 'accounts-service', 'com.endlessm.ParentalControls.SessionLimits.xml'), + join_paths(meson.current_source_dir(), '..', '..', 'accounts-service', 'com.endlessm.ParentalControls.AppFilter.xml'), + join_paths(meson.current_source_dir(), '..', '..', 'accounts-service', 'com.endlessm.ParentalControls.SessionLimits.xml'), ] accounts_service_extension_iface_h = custom_target( diff --git a/malcontent-control/meson.build b/malcontent-control/meson.build index 7ade11b..8263306 100644 --- a/malcontent-control/meson.build +++ b/malcontent-control/meson.build @@ -7,7 +7,7 @@ endif resources = gnome.compile_resources( 'resources', 'malcontent-control.gresource.xml', - source_dir: meson.source_root(), + source_dir: meson.current_source_dir(), ) malcontent_control = executable('malcontent-control', @@ -40,7 +40,7 @@ desktop_file = i18n.merge_file('desktop-file', type: 'desktop', input: '@0@.desktop.in'.format(application_id), output: '@0@.desktop'.format(application_id), - po_dir: join_paths(meson.source_root(), 'po'), + po_dir: join_paths(meson.current_source_dir(), '..', 'po'), install: true, install_dir: join_paths(get_option('datadir'), 'applications'), ) @@ -60,7 +60,7 @@ endif appdata_file = i18n.merge_file('appdata-file', input: '@0@.appdata.xml.in'.format(application_id), output: '@0@.appdata.xml'.format(application_id), - po_dir: join_paths(meson.source_root(), 'po'), + po_dir: join_paths(meson.current_source_dir(), '..', 'po'), install: true, install_dir: join_paths(get_option('datadir'), 'metainfo'), ) @@ -97,7 +97,7 @@ endif policy_file = i18n.merge_file('policy-file', input: '@0@.policy.in'.format(application_id), output: '@0@.policy'.format(application_id), - po_dir: join_paths(meson.source_root(), 'po'), + po_dir: join_paths(meson.current_source_dir(), '..', 'po'), install: true, install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions'), ) diff --git a/meson.build b/meson.build index 6e1dfa5..221bf19 100644 --- a/meson.build +++ b/meson.build @@ -13,8 +13,8 @@ gnome = import('gnome') i18n = import('i18n') pkgconfig = import('pkgconfig') -meson_make_symlink = join_paths(meson.source_root(), 'tools', 'meson-make-symlink.py') -po_dir = join_paths(meson.source_root(), 'po') +meson_make_symlink = join_paths(meson.current_source_dir(), 'tools', 'meson-make-symlink.py') +po_dir = join_paths(meson.current_source_dir(), 'po') prefix = get_option('prefix') bindir = join_paths(prefix, get_option('bindir'))