diff options
-rw-r--r-- | interpreter.py | 8 | ||||
-rw-r--r-- | test cases/common/49 subproject/meson.build | 2 | ||||
-rw-r--r-- | test cases/common/49 subproject/subprojects/sublib/meson.build | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/interpreter.py b/interpreter.py index db16568..0bf8797 100644 --- a/interpreter.py +++ b/interpreter.py @@ -568,6 +568,7 @@ class MesonMain(InterpreterObject): 'is_cross_build' : self.is_cross_build_method, 'has_exe_wrapper' : self.has_exe_wrapper_method, 'is_unity' : self.is_unity_method, + 'is_subproject' : self.is_subproject_method, 'current_source_dir' : self.current_source_dir_method, 'current_build_dir' : self.current_build_dir_method, 'set_install_script' : self.set_install_script_method, @@ -631,6 +632,9 @@ class MesonMain(InterpreterObject): def is_unity_method(self, args, kwargs): return self.build.environment.coredata.unity + def is_subproject_method(self, args, kwargs): + return self.interpreter.subproject != '' + class Interpreter(): def __init__(self, build, subproject='', subdir=''): @@ -700,7 +704,6 @@ class Interpreter(): 'option' : self.func_option, 'get_option' : self.func_get_option, 'subproject' : self.func_subproject, - 'is_subproject' : self.func_is_subproject, 'pkgconfig_gen' : self.func_pkgconfig_gen, } @@ -867,9 +870,6 @@ class Interpreter(): p = build.PkgConfigGenerator(libs, subdirs, name, description, version, filebase) self.build.pkgconfig_gens.append(p) - def func_is_subproject(self, nodes, args, kwargs): - return self.subproject != '' - def func_subproject(self, nodes, args, kwargs): if len(args) != 1: raise InterpreterException('Subproject takes exactly one argument') diff --git a/test cases/common/49 subproject/meson.build b/test cases/common/49 subproject/meson.build index 5fe39f7..613a9f3 100644 --- a/test cases/common/49 subproject/meson.build +++ b/test cases/common/49 subproject/meson.build @@ -2,7 +2,7 @@ project('subproj user', 'c') sub = subproject('sublib') -if is_subproject() +if meson.is_subproject() error('Claimed to be a subproject even though we are the master project.') endif diff --git a/test cases/common/49 subproject/subprojects/sublib/meson.build b/test cases/common/49 subproject/subprojects/sublib/meson.build index 5ecc77a..d8e4140 100644 --- a/test cases/common/49 subproject/subprojects/sublib/meson.build +++ b/test cases/common/49 subproject/subprojects/sublib/meson.build @@ -1,6 +1,6 @@ project('subproject', 'c') -if not is_subproject() +if not meson.is_subproject() error('Claimed to be master project even though we are a subproject.') endif |