diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-08-30 23:56:09 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-08-30 23:56:09 +0300 |
commit | 24ea586d1e8a4dbb65edc175a9ba677b776ac3de (patch) | |
tree | d3bf5da9199dd88b0e1f77533b86679328feaebd | |
parent | 845eda2938f67cae3b7bccf813b994441a2c8a5d (diff) | |
download | meson-24ea586d1e8a4dbb65edc175a9ba677b776ac3de.zip meson-24ea586d1e8a4dbb65edc175a9ba677b776ac3de.tar.gz meson-24ea586d1e8a4dbb65edc175a9ba677b776ac3de.tar.bz2 |
More introspection.
-rw-r--r-- | interpreter.py | 6 | ||||
-rw-r--r-- | test cases/common/39 tryrun/meson.build | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/interpreter.py b/interpreter.py index 9cf45a1..6296f55 100644 --- a/interpreter.py +++ b/interpreter.py @@ -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() diff --git a/test cases/common/39 tryrun/meson.build b/test cases/common/39 tryrun/meson.build index a45d3e2..78847c5 100644 --- a/test cases/common/39 tryrun/meson.build +++ b/test cases/common/39 tryrun/meson.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) { |