aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/objc.py
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-03-19 20:44:51 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2019-03-27 10:54:56 -0400
commitf4da210f464446d92600456508439d2f926e6cea (patch)
tree453a9a73eebc21dc055e20fa3911c0093d265245 /mesonbuild/compilers/objc.py
parentb565eff084faeea8a8952ec2c1fe40483705aaef (diff)
downloadmeson-f4da210f464446d92600456508439d2f926e6cea.zip
meson-f4da210f464446d92600456508439d2f926e6cea.tar.gz
meson-f4da210f464446d92600456508439d2f926e6cea.tar.bz2
Sanity check with external args
Previously cross, but not native, external args were used. Then in d451a4bd97f827bb492fd0c0e357cb20b6056ed9 the cross special cases were removed, so external args are never used. This commit switches that so they are always used. Sanity checking works just the same as compiler checks like has header / has library.
Diffstat (limited to 'mesonbuild/compilers/objc.py')
-rw-r--r--mesonbuild/compilers/objc.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py
index 8dfd0a2..c4a7019 100644
--- a/mesonbuild/compilers/objc.py
+++ b/mesonbuild/compilers/objc.py
@@ -14,7 +14,7 @@
import os.path, subprocess
-from ..mesonlib import EnvironmentException
+from ..mesonlib import EnvironmentException, MachineChoice
from .c import CCompiler
from .compilers import ClangCompiler, GnuCompiler
@@ -31,9 +31,15 @@ class ObjCCompiler(CCompiler):
# TODO try to use sanity_check_impl instead of duplicated code
source_name = os.path.join(work_dir, 'sanitycheckobjc.m')
binary_name = os.path.join(work_dir, 'sanitycheckobjc')
- extra_flags = []
+ if environment.is_cross_build() and not self.is_cross:
+ for_machine = MachineChoice.BUILD
+ else:
+ for_machine = MachineChoice.HOST
+ extra_flags = environment.coredata.get_external_args(for_machine, self.language)
if self.is_cross:
extra_flags += self.get_compile_only_args()
+ else:
+ extra_flags += environment.coredata.get_external_link_args(for_machine, self.language)
with open(source_name, 'w') as ofile:
ofile.write('#import<stdio.h>\n'
'int main(int argc, char **argv) { return 0; }\n')