aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-12-09 22:47:20 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-12-09 22:47:20 +0200
commit2e91184b38aef2b5c991a619ceaf014f8ccab71c (patch)
treeb4c6cb5919e14248271865e3a96241cc7aed438e /interpreter.py
parent9cde4e4012e5a02987bf2b2ac0f06d0c27ff2e7b (diff)
downloadmeson-2e91184b38aef2b5c991a619ceaf014f8ccab71c.zip
meson-2e91184b38aef2b5c991a619ceaf014f8ccab71c.tar.gz
meson-2e91184b38aef2b5c991a619ceaf014f8ccab71c.tar.bz2
Can check if running as a subproject.
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/interpreter.py b/interpreter.py
index 3ce1feb..e655697 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -614,6 +614,7 @@ class Interpreter():
'option' : self.func_option,
'get_option' : self.func_get_option,
'subproject' : self.func_subproject,
+ 'is_subproject' : self.func_is_subproject,
}
def get_build_def_files(self):
@@ -730,6 +731,9 @@ class Interpreter():
def func_option(self, nodes, args, kwargs):
raise InterpreterException('Tried to call option() in build description file. All options must be in the option file.')
+ 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')