diff options
Diffstat (limited to 'mesonbuild/compilers/objcpp.py')
-rw-r--r-- | mesonbuild/compilers/objcpp.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index 6743f89..2e81b4c 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -21,9 +21,9 @@ from .clike import CLikeCompiler from .compilers import Compiler, ClangCompiler, GnuCompiler class ObjCPPCompiler(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 = 'objcpp' - 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 ObjCPPCompiler(CLikeCompiler, Compiler): # 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') - 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' 'class MyClass;' @@ -60,8 +56,8 @@ class ObjCPPCompiler(CLikeCompiler, Compiler): class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None): - ObjCPPCompiler.__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): + ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper) GnuCompiler.__init__(self, compiler_type, defines) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], @@ -71,8 +67,8 @@ class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler): class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None): - ObjCPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None): + ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper) ClangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], |