aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-12-27 00:25:45 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-12-27 00:25:45 +0200
commit3500ddb8bb311bd99d2a76c6cd7bfe0788d5ad23 (patch)
treed1f8c846835244c8758bfb9fa7b8de2ea14559d4
parente5b59ac9e9d641fef5b12c39c69ed1320682e475 (diff)
downloadmeson-3500ddb8bb311bd99d2a76c6cd7bfe0788d5ad23.zip
meson-3500ddb8bb311bd99d2a76c6cd7bfe0788d5ad23.tar.gz
meson-3500ddb8bb311bd99d2a76c6cd7bfe0788d5ad23.tar.bz2
Skip extraction test during Unity build because the object file is not generated.
-rw-r--r--interpreter.py8
-rw-r--r--test cases/common/25 object extraction/meson.build12
2 files changed, 15 insertions, 5 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()
diff --git a/test cases/common/25 object extraction/meson.build b/test cases/common/25 object extraction/meson.build
index a039a8c..f936609 100644
--- a/test cases/common/25 object extraction/meson.build
+++ b/test cases/common/25 object extraction/meson.build
@@ -1,7 +1,11 @@
project('object extraction', 'c')
-lib = shared_library('somelib', 'lib.c')
-obj = lib.extract_objects('lib.c')
+if meson.is_unity()
+ message('Skipping extraction test because this is a Unity build.')
+else
+ lib = shared_library('somelib', 'lib.c')
+ obj = lib.extract_objects('lib.c')
-e = executable('main', 'main.c', objects : obj)
-test('extraction test', e)
+ e = executable('main', 'main.c', objects : obj)
+ test('extraction test', e)
+endif