From d7ee2ec7c0f2e69c4145a5db21aecbf602a344fb Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 12 Apr 2019 23:48:04 +0300 Subject: Even more fixes. --- mesonbuild/compilers/fortran.py | 8 ++------ mesonbuild/compilers/objc.py | 8 ++------ mesonbuild/compilers/objcpp.py | 8 ++------ mesonbuild/compilers/swift.py | 8 ++------ mesonbuild/compilers/vala.py | 6 +----- run_project_tests.py | 4 ++-- 6 files changed, 11 insertions(+), 31 deletions(-) diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 3fee43b..0fe2633 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -60,12 +60,8 @@ class FortranCompiler(CLikeCompiler, Compiler): source_name.write_text('print *, "Fortran compilation is working."; end') - 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_link_args(for_machine, self.language) + extra_flags = environment.coredata.get_external_args(self.language) + extra_flags += environment.coredata.get_external_link_args(self.language) # %% build the test executable pc = subprocess.Popen(self.exelist + extra_flags + [str(source_name), '-o', str(binary_name)]) pc.wait() diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py index 55311ed..ac46aab 100644 --- a/mesonbuild/compilers/objc.py +++ b/mesonbuild/compilers/objc.py @@ -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.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.language) with open(source_name, 'w') as ofile: ofile.write('#import\n' 'int main(int argc, char **argv) { return 0; }\n') diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index 6743f89..2c56677 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -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.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.language) with open(source_name, 'w') as ofile: ofile.write('#import\n' 'class MyClass;' diff --git a/mesonbuild/compilers/swift.py b/mesonbuild/compilers/swift.py index 17705ac..0f2a241 100644 --- a/mesonbuild/compilers/swift.py +++ b/mesonbuild/compilers/swift.py @@ -102,15 +102,11 @@ class SwiftCompiler(Compiler): src = 'swifttest.swift' source_name = os.path.join(work_dir, src) output_name = os.path.join(work_dir, 'swifttest') - 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.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.language) with open(source_name, 'w') as ofile: ofile.write('''print("Swift compilation is working.") ''') diff --git a/mesonbuild/compilers/vala.py b/mesonbuild/compilers/vala.py index 18f000e..74e3d39 100644 --- a/mesonbuild/compilers/vala.py +++ b/mesonbuild/compilers/vala.py @@ -110,11 +110,7 @@ class ValaCompiler(Compiler): # no extra dirs are specified. if not extra_dirs: code = 'class MesonFindLibrary : Object { }' - if env.is_cross_build() and not self.is_cross: - for_machine = MachineChoice.BUILD - else: - for_machine = MachineChoice.HOST - args = env.coredata.get_external_args(for_machine, self.language) + args = env.coredata.get_external_args(self.language) vapi_args = ['--pkg', libname] args += vapi_args with self.cached_compile(code, env.coredata, extra_args=args, mode='compile') as p: diff --git a/run_project_tests.py b/run_project_tests.py index b9077c9..8d811c9 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -461,7 +461,7 @@ def have_objc_compiler(): return False if not objc_comp: return False - env.coredata.process_new_compilers('objc', objc_comp, None, env) + env.coredata.process_new_compilers('objc', objc_comp, None, []) try: objc_comp.sanity_check(env.get_scratch_dir(), env) except mesonlib.MesonException: @@ -477,7 +477,7 @@ def have_objcpp_compiler(): return False if not objcpp_comp: return False - env.coredata.process_new_compilers('objcpp', objcpp_comp, None, env) + env.coredata.process_new_compilers('objcpp', objcpp_comp, None, []) try: objcpp_comp.sanity_check(env.get_scratch_dir(), env) except mesonlib.MesonException: -- cgit v1.1