Skip extraction test during Unity build because the object file is not generated.

pull/15/head
Jussi Pakkanen 11 years ago
parent e5b59ac9e9
commit 3500ddb8bb
  1. 6
      interpreter.py
  2. 12
      test cases/common/25 object extraction/meson.build

@ -522,6 +522,7 @@ 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):
@ -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()

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

Loading…
Cancel
Save