summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2019-08-28 11:54:11 +0200
committerThomas Haller <thaller@redhat.com>2019-10-01 09:49:33 +0200
commit82e79e40a5ca05b5fa9a40cfb55c9c775ac8c849 (patch)
treea9ce3e6dbd23f8e071b9d0d36a71b670c2a77a52 /meson.build
parent48bb5b68e3d7dd44d9130e059ef99c14fb5ca457 (diff)
downloadNetworkManager-82e79e40a5ca05b5fa9a40cfb55c9c775ac8c849.tar.gz
meson: Avoid the use of source_root and build_root methods
The way some directory paths are defined has also been changed to avoid the use of the `source_root` and `build_root` functions because they are discouraged[0] [0] https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build21
1 files changed, 12 insertions, 9 deletions
diff --git a/meson.build b/meson.build
index 69408ad348..9dc059ee64 100644
--- a/meson.build
+++ b/meson.build
@@ -69,6 +69,9 @@ gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
+source_root = meson.current_source_dir()
+build_root = meson.current_build_dir()
+
po_dir = join_paths(meson.source_root(), 'po')
intltool_merge = find_program('intltool-merge')
@@ -81,7 +84,7 @@ top_inc = include_directories('.')
perl = find_program('perl')
xsltproc = find_program('xsltproc')
-check_exports = find_program(join_paths(meson.source_root(), 'tools', 'check-exports.sh'))
+check_exports = find_program(join_paths(source_root, 'tools', 'check-exports.sh'))
cc = meson.get_compiler('c')
@@ -190,9 +193,9 @@ endif
add_project_arguments(common_flags, language: 'c')
add_project_link_arguments(common_ldflags, language: 'c')
-linker_script_binary = join_paths(meson.source_root(), 'linker-script-binary.ver')
-linker_script_devices = join_paths(meson.source_root(), 'linker-script-devices.ver')
-linker_script_settings = join_paths(meson.source_root(), 'linker-script-settings.ver')
+linker_script_binary = join_paths(source_root, 'linker-script-binary.ver')
+linker_script_devices = join_paths(source_root, 'linker-script-devices.ver')
+linker_script_settings = join_paths(source_root, 'linker-script-settings.ver')
ldflags_linker_script_binary = [ '-Wl,--version-script,@0@'.format(linker_script_binary) ]
ldflags_linker_script_devices = [ '-Wl,--version-script,@0@'.format(linker_script_devices) ]
@@ -736,7 +739,7 @@ endif
tests = get_option('tests')
enable_tests = (tests != 'no')
require_root_tests = (tests == 'root')
-test_script = find_program(join_paths(meson.source_root(), 'tools', 'run-nm-test.sh'))
+test_script = find_program(join_paths(source_root, 'tools', 'run-nm-test.sh'))
# valgrind
locations = get_option('valgrind')
@@ -749,13 +752,13 @@ endif
if enable_valgrind
valgrind_suppressions_path = get_option('valgrind_suppressions')
if valgrind_suppressions_path == ''
- valgrind_suppressions_path = join_paths(meson.source_root(), 'valgrind.suppressions')
+ valgrind_suppressions_path = join_paths(source_root, 'valgrind.suppressions')
endif
endif
test_args = [
'--called-from-make',
- meson.build_root(),
+ build_root,
'',
enable_valgrind ? valgrind.path() : '',
enable_valgrind ? valgrind_suppressions_path : '',
@@ -866,8 +869,8 @@ config_extra_h.set_quoted('NMPLUGINDIR', nm_plugindir)
config_extra_h.set_quoted('NMRUNDIR', nm_pkgrundir)
config_extra_h.set_quoted('NMSTATEDIR', nm_pkgstatedir)
config_extra_h.set_quoted('NMVPNDIR', nm_vpndir)
-config_extra_h.set_quoted('NM_BUILD_BUILDDIR', meson.build_root())
-config_extra_h.set_quoted('NM_BUILD_SRCDIR', meson.source_root())
+config_extra_h.set_quoted('NM_BUILD_BUILDDIR', build_root)
+config_extra_h.set_quoted('NM_BUILD_SRCDIR', source_root)
if enable_ppp
config_extra_h.set_quoted('PPPD_PLUGIN_DIR', pppd_plugin_dir)
endif