More introspection.

pull/15/head
Jussi Pakkanen 12 years ago
parent 845eda2938
commit 24ea586d1e
  1. 6
      interpreter.py
  2. 11
      test cases/common/39 tryrun/meson.build

@ -800,8 +800,14 @@ class MesonMain(InterpreterObject):
self.build = build
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,
})
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()

@ -1,6 +1,15 @@
project('tryrun', 'c')
cc = meson.get_compiler('c')
# Complex to exercise all code paths.
if meson.is_cross_build()
if meson.has_exe_wrapper()
cc = meson.get_compiler('c', native : false)
else
cc = meson.get_compiler('c', native : true)
endif
else
cc = meson.get_compiler('c')
endif
ok_code = '''#include<stdio.h>
int main(int argc, char **argv) {

Loading…
Cancel
Save