meson: Define srcdir and builddir using meson functions

No need to redefine paths starting from top src/build dirs, as meson can give us
this information for free using its functions.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
This commit is contained in:
Marco Trevisan (Treviño) 2019-04-04 22:35:44 -04:00 committed by Marco Trevisan
parent 8374be46d2
commit 63c40a9711
9 changed files with 9 additions and 20 deletions

View File

@ -1,7 +1,5 @@
clutter_includesubdir = join_paths(pkgname, 'clutter')
clutter_includedir = join_paths(includedir, clutter_includesubdir)
clutter_srcdir = join_paths(top_srcdir, 'clutter')
clutter_builddir = join_paths(builddir, 'clutter')
clutter_includepath = include_directories('.', 'clutter')
clutter_includes = [clutter_includepath, cogl_includepath]

View File

@ -1,6 +1,3 @@
clutter_tests_conform_srcdir = join_paths(clutter_srcdir, 'tests/conform')
clutter_tests_conform_builddir = join_paths(clutter_builddir, 'tests/conform')
clutter_tests_conform_c_args = [
'-DG_LOG_DOMAIN="Clutter-Conform"',
'-DCOGL_DISABLE_DEPRECATION_WARNINGS',
@ -52,8 +49,8 @@ clutter_conform_tests += clutter_conform_tests_general_tests
clutter_conform_tests += clutter_conform_tests_deprecated_tests
test_env = environment()
test_env.set('G_TEST_SRCDIR', clutter_tests_conform_srcdir)
test_env.set('G_TEST_BUILDDIR', clutter_tests_conform_builddir)
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
test_env.set('G_ENABLE_DIAGNOSTIC', '0')
test_env.set('CLUTTER_ENABLE_DIAGNOSTIC', '0')
test_env.set('CLUTTER_SCALE', '1')

View File

@ -1,7 +1,5 @@
clutter_tests_interactive_srcdir = join_paths(clutter_srcdir, 'tests/interactive')
clutter_tests_interactive_srcdir = meson.current_source_dir()
clutter_tests_interactive_includepath = include_directories('.')
#clutter_tests_interactive_builddir = join_paths(clutter_builddir, 'tests/interactive')
clutter_tests_interactive_c_args = [
'-DTESTS_DATADIR="@0@"'.format(clutter_tests_interactive_srcdir),

View File

@ -1,5 +1,5 @@
clutter_tests_performance_c_args = [
'-DTESTS_DATA_DIR="@0@"'.format(join_paths(clutter_srcdir, 'tests/interactive')),
'-DTESTS_DATA_DIR="@0@"'.format(clutter_tests_interactive_srcdir),
'-DG_DISABLE_SINGLE_INCLUDES',
'-DGLIB_DISABLE_DEPRECATION_WARNINGS',
'-DCOGL_DISABLE_DEPRECATION_WARNINGS',

View File

@ -1,7 +1,6 @@
cogl_includesubdir = join_paths(pkgname, 'cogl')
cogl_includedir = join_paths(includedir, cogl_includesubdir)
cogl_srcdir = join_paths(top_srcdir, 'cogl')
cogl_builddir = join_paths(builddir, 'cogl')
cogl_srcdir = meson.current_source_dir()
cogl_includepath = include_directories('.', 'cogl')

View File

@ -7,7 +7,7 @@ custom_target('mutter.desktop',
msgfmt,
'--desktop', '--template',
'@INPUT@',
'-d', join_paths(top_srcdir, 'po'),
'-d', join_paths(meson.source_root(), 'po'),
'-o', '@OUTPUT@'
],
install: true,

View File

@ -70,9 +70,6 @@ pcdir = join_paths(libdir, 'pkgconfig')
gettext_package = meson.project_name()
localedir = join_paths(datadir, 'locale')
top_srcdir = meson.current_source_dir()
builddir = meson.current_build_dir()
libmutter_name = 'mutter-' + libmutter_api_version
mutter_installed_tests_datadir = join_paths(

View File

@ -639,7 +639,7 @@ if have_native_backend
'--interface-prefix', 'org.freedesktop.login1',
'--c-namespace', 'Login1',
'--generate-c-code', 'meta-dbus-login1',
'--output-directory', join_paths(builddir, 'src'),
'--output-directory', meson.current_build_dir(),
'--c-generate-autocleanup', 'all',
'@INPUT@',
]

View File

@ -27,8 +27,8 @@ if have_installed_tests
endif
test_env = environment()
test_env.set('G_TEST_SRCDIR', join_paths(top_srcdir, 'src'))
test_env.set('G_TEST_BUILDDIR', builddir)
test_env.set('G_TEST_SRCDIR', join_paths(meson.source_root(), 'src'))
test_env.set('G_TEST_BUILDDIR', meson.build_root())
test_env.set('MUTTER_TEST_PLUGIN_PATH', '@0@'.format(default_plugin.full_path()))
test_client = executable('mutter-test-client',