aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-06-15 10:48:53 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-06-15 11:03:28 +0530
commit777c1e9c199fe641c5b9b3111d558f1cc9770288 (patch)
tree12bb66870882cda260d2193ba86c0a669d9b21f0 /mesonbuild/compilers.py
parentf7eef79c0dd8adf74f79a85ca814f07c9beb4e29 (diff)
downloadmeson-777c1e9c199fe641c5b9b3111d558f1cc9770288.zip
meson-777c1e9c199fe641c5b9b3111d558f1cc9770288.tar.gz
meson-777c1e9c199fe641c5b9b3111d558f1cc9770288.tar.bz2
compilers: Fix usage of cross tools args in sanity checks
The cross-extra-flags were being overwritten and ignored. Also, we don't link while doing a cross-compiled sanity check even with ObjC++
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 4756013..ca9d2fe 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -451,7 +451,7 @@ class CCompiler(Compiler):
# a ton of compiler flags to differentiate between
# arm and x86_64. So just compile.
extra_flags += self.get_cross_extra_flags(environment, compile=True, link=False)
- extra_flags = self.get_compile_only_args()
+ extra_flags += self.get_compile_only_args()
else:
extra_flags += self.get_cross_extra_flags(environment, compile=True, link=True)
# Is a valid executable output for all toolchains and platforms
@@ -876,7 +876,7 @@ class ObjCCompiler(CCompiler):
binary_name = os.path.join(work_dir, 'sanitycheckobjc')
extra_flags = self.get_cross_extra_flags(environment, compile=True, link=False)
if self.is_cross:
- extra_flags = self.get_compile_only_args()
+ extra_flags += self.get_compile_only_args()
ofile = open(source_name, 'w')
ofile.write('#import<stdio.h>\nint main(int argc, char **argv) { return 0; }\n')
ofile.close()
@@ -908,9 +908,9 @@ class ObjCPPCompiler(CPPCompiler):
# TODO try to use sanity_check_impl instead of duplicated code
source_name = os.path.join(work_dir, 'sanitycheckobjcpp.mm')
binary_name = os.path.join(work_dir, 'sanitycheckobjcpp')
- extra_flags = self.get_cross_extra_flags(environment, compile=True, link=True)
+ extra_flags = self.get_cross_extra_flags(environment, compile=True, link=False)
if self.is_cross:
- extra_flags = self.get_compile_only_args()
+ extra_flags += self.get_compile_only_args()
ofile = open(source_name, 'w')
ofile.write('#import<stdio.h>\nclass MyClass;int main(int argc, char **argv) { return 0; }\n')
ofile.close()