aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/interpreter.py b/interpreter.py
index e655697..402a185 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -522,13 +522,14 @@ class MesonMain(InterpreterObject):
self.methods.update({'get_compiler': self.get_compiler_method,
'is_cross_build' : self.is_cross_build_method,
'has_exe_wrapper' : self.has_exe_wrapper_method,
+ 'is_unity' : self.is_unity_method,
})
def has_exe_wrapper_method(self, args, kwargs):
if self.is_cross_build_method(None, None):
return 'exe_wrap' in self.build.environment.cross_info
return True # This is semantically confusing.
-
+
def is_cross_build_method(self, args, kwargs):
return self.build.environment.is_cross_build()
@@ -553,6 +554,9 @@ class MesonMain(InterpreterObject):
return CompilerHolder(c, self.build.environment)
raise InterpreterException('Tried to access compiler for unspecified language "%s".' % cname)
+ def is_unity_method(self, args, kwargs):
+ return self.build.environment.coredata.unity
+
class Interpreter():
def __init__(self, build, subproject=''):
@@ -1181,6 +1185,8 @@ class Interpreter():
else:
obj = self.evaluate_statement(invokable)
method_name = node.method_name.get_value()
+ if method_name == 'extract_objects' and self.environment.coredata.unity:
+ raise InterpreterException('Single object files can not be extracted in Unity builds.')
args = node.arguments
if isinstance(obj, nodes.StringStatement):
obj = obj.get_value()