Also add support for declare_dependency objects

pull/5953/head
Daniel Mensinger 6 years ago
parent 061deec993
commit a7c4682be1
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 4
      mesonbuild/build.py
  2. 7
      test cases/common/226 is_system dependency/meson.build
  3. 3
      test cases/common/226 is_system dependency/subprojects/subDep/meson.build

@ -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):

@ -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')

@ -0,0 +1,3 @@
project('subDep', ['cpp'])
subDep_dep = declare_dependency(compile_args : [])
Loading…
Cancel
Save