[grilo/sam/meson-subproject-fix] build: Avoid using meson.source_root()
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo/sam/meson-subproject-fix] build: Avoid using meson.source_root()
- Date: Sun, 29 Sep 2019 14:52:57 +0000 (UTC)
commit b88735d143434bd6c7c4e25671b296e97ee5c30d
Author: Sam Thursfield <sam afuera me uk>
Date: Sun Sep 29 16:51:23 2019 +0200
build: Avoid using meson.source_root()
The value of meson.source_root() can't be trusted because if we are
embedded via subproject() into a larger project, the source root will
be that of the parent project.
Instead, use a variable to keep track of the toplevel source directory.
doc/grilo/meson.build | 14 +++++++-------
meson.build | 2 ++
tools/grilo-inspect/meson.build | 2 +-
3 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/doc/grilo/meson.build b/doc/grilo/meson.build
index b87d25d..ef5740f 100644
--- a/doc/grilo/meson.build
+++ b/doc/grilo/meson.build
@@ -23,8 +23,8 @@ private_headers = [
gnome.gtkdoc('grilo',
main_sgml: 'grilo-docs.sgml',
src_dir: [
- join_paths(meson.source_root(), 'src'),
- join_paths(meson.source_root(), 'libs'),
+ join_paths(source_root, 'src'),
+ join_paths(source_root, 'libs'),
],
dependencies: libgrl_dep,
gobject_typesfile: types,
@@ -37,10 +37,10 @@ gnome.gtkdoc('grilo',
'quick-start.xml',
'writing-apps.xml',
'overview.xml',
- join_paths(meson.source_root(), 'examples', 'configuring-plugins.c'),
- join_paths(meson.source_root(), 'examples', 'browsing.c'),
- join_paths(meson.source_root(), 'examples', 'searching.c'),
- join_paths(meson.source_root(), 'examples', 'multivalues.c'),
- join_paths(meson.source_root(), 'examples', 'efficient-metadata-resolution.c'),
+ join_paths(source_root, 'examples', 'configuring-plugins.c'),
+ join_paths(source_root, 'examples', 'browsing.c'),
+ join_paths(source_root, 'examples', 'searching.c'),
+ join_paths(source_root, 'examples', 'multivalues.c'),
+ join_paths(source_root, 'examples', 'efficient-metadata-resolution.c'),
]
)
diff --git a/meson.build b/meson.build
index 952651e..846041b 100644
--- a/meson.build
+++ b/meson.build
@@ -72,6 +72,8 @@ if enable_testui
oauth_dep = dependency('oauth', required: false)
endif
+source_root = meson.current_source_dir()
+
prefix = get_option('prefix')
includedir = join_paths(prefix, get_option('includedir'))
libdir = join_paths(prefix, get_option('libdir'))
diff --git a/tools/grilo-inspect/meson.build b/tools/grilo-inspect/meson.build
index 048c232..3dd6c2f 100644
--- a/tools/grilo-inspect/meson.build
+++ b/tools/grilo-inspect/meson.build
@@ -14,7 +14,7 @@ if not python.found()
endif
run_command(python,
'@0@/generate_core_keys.py'.format(meson.current_source_dir()),
- '@0@/src/grl-metadata-key.h'.format(meson.source_root()),
+ '@0@/src/grl-metadata-key.h'.format(source_root),
'@0@/grl-core-keys.h'.format(meson.current_build_dir()))
configure_file(output: 'config.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]