diff options
Diffstat (limited to 'mesonbuild/compilers/objc.py')
-rw-r--r-- | mesonbuild/compilers/objc.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py index 55311ed..f9ca793 100644 --- a/mesonbuild/compilers/objc.py +++ b/mesonbuild/compilers/objc.py @@ -21,9 +21,9 @@ from .clike import CLikeCompiler from .compilers import Compiler, ClangCompiler, GnuCompiler class ObjCCompiler(CLikeCompiler, Compiler): - def __init__(self, exelist, version, is_cross: bool, exe_wrap: typing.Optional[str]): + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, exe_wrap: typing.Optional[str]): self.language = 'objc' - Compiler.__init__(self, exelist, version) + Compiler.__init__(self, exelist, version, for_machine) CLikeCompiler.__init__(self, is_cross, exe_wrap) def get_display_language(self): @@ -33,15 +33,11 @@ class ObjCCompiler(CLikeCompiler, Compiler): # 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') - 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) + extra_flags = environment.coredata.get_external_args(self.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) + extra_flags += environment.coredata.get_external_link_args(self.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') @@ -59,8 +55,8 @@ class ObjCCompiler(CLikeCompiler, Compiler): class GnuObjCCompiler(GnuCompiler, ObjCCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None): - ObjCCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None): + ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper) GnuCompiler.__init__(self, compiler_type, defines) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], @@ -70,8 +66,8 @@ class GnuObjCCompiler(GnuCompiler, ObjCCompiler): class ClangObjCCompiler(ClangCompiler, ObjCCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None): - ObjCCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None): + ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper) ClangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], |