aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-09-24 23:58:29 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-10-03 10:06:04 +0200
commita7c4682be1e379ba655b7ea25e68d73f1605d62d (patch)
treed64dc382caeb240740978137f64cdf75ca0f3d59
parent061deec9939b35d0e0707e07fc1e9e762f419457 (diff)
downloadmeson-a7c4682be1e379ba655b7ea25e68d73f1605d62d.zip
meson-a7c4682be1e379ba655b7ea25e68d73f1605d62d.tar.gz
meson-a7c4682be1e379ba655b7ea25e68d73f1605d62d.tar.bz2
Also add support for declare_dependency objects
-rw-r--r--mesonbuild/build.py4
-rw-r--r--test cases/common/226 is_system dependency/meson.build7
-rw-r--r--test cases/common/226 is_system dependency/subprojects/subDep/meson.build3
3 files changed, 13 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 0c3d982..e9b2a4a 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1150,7 +1150,7 @@ You probably should put it in link_with instead.''')
raise MesonException('File %s does not exist.' % f)
self.pch[language] = pchlist
- def add_include_dirs(self, args):
+ def add_include_dirs(self, args, set_is_system: typing.Optional[bool] = None):
ids = []
for a in args:
# FIXME same hack, forcibly unpack from holder.
@@ -1159,6 +1159,8 @@ You probably should put it in link_with instead.''')
if not isinstance(a, IncludeDirs):
raise InvalidArguments('Include directory to be added is not an include directory object.')
ids.append(a)
+ if set_is_system is not None:
+ ids = [IncludeDirs(x.get_curdir(), x.get_incdirs(), set_is_system, x.get_extra_build_dirs()) for x in ids]
self.include_dirs += ids
def add_compiler_args(self, language, args):
diff --git a/test cases/common/226 is_system dependency/meson.build b/test cases/common/226 is_system dependency/meson.build
index e96cd0a..a3f60d2 100644
--- a/test cases/common/226 is_system dependency/meson.build
+++ b/test cases/common/226 is_system dependency/meson.build
@@ -18,3 +18,10 @@ assert(dep2.is_system() == true, 'is_system must be true when set')
dep2_sys = dep2.as_system(false)
assert(dep2_sys.is_system() == false, 'as_system must set is_system correctly')
+
+sp = subproject('subDep')
+sp_dep = sp.get_variable('subDep_dep')
+assert(sp_dep.is_system() == false, 'default is false')
+
+sp_dep_sys = sp_dep.as_system(true)
+assert(sp_dep_sys.is_system() == true, 'changing is_system works')
diff --git a/test cases/common/226 is_system dependency/subprojects/subDep/meson.build b/test cases/common/226 is_system dependency/subprojects/subDep/meson.build
new file mode 100644
index 0000000..c3e87c4
--- /dev/null
+++ b/test cases/common/226 is_system dependency/subprojects/subDep/meson.build
@@ -0,0 +1,3 @@
+project('subDep', ['cpp'])
+
+subDep_dep = declare_dependency(compile_args : [])