diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-10-18 00:04:45 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-10-18 00:04:45 +0300 |
commit | 1c186d4a300f4e0d4355d9ce1f5c16af54d27dd9 (patch) | |
tree | 6d8d1e4a5ff909a3da86101025f9c6ca08a4537c /compilers.py | |
parent | a05f0385e3ba8a3cf95dea1ed6cf9c8bb266c707 (diff) | |
download | meson-1c186d4a300f4e0d4355d9ce1f5c16af54d27dd9.zip meson-1c186d4a300f4e0d4355d9ce1f5c16af54d27dd9.tar.gz meson-1c186d4a300f4e0d4355d9ce1f5c16af54d27dd9.tar.bz2 |
Only compile when doing cross compilation sanity checks because linking gets way too complicated.
Diffstat (limited to 'compilers.py')
-rw-r--r-- | compilers.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/compilers.py b/compilers.py index ec618e9..72e9f30 100644 --- a/compilers.py +++ b/compilers.py @@ -263,7 +263,16 @@ class CCompiler(Compiler): ofile = open(source_name, 'w') ofile.write('int main(int argc, char **argv) { int class=0; return class; }\n') ofile.close() - pc = subprocess.Popen(self.exelist + [source_name, '-o', binary_name]) + if self.is_cross and self.exe_wrapper is None: + # Linking cross built apps is painful. You can't really + # tell if you should use -nostdlib or not and for example + # on OSX the compiler binary is the same but you need + # a ton of compiler flags to differentiate between + # arm and x86_64. So just compile. + extra_flags = ['-c'] + else: + extra_flags = [] + pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name]) pc.wait() if pc.returncode != 0: raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string()) |