aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-04-12 23:48:04 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2019-05-10 00:50:52 +0300
commitd7ee2ec7c0f2e69c4145a5db21aecbf602a344fb (patch)
treef67083474d556bb5038f8e328b00aeda6ca7bb83
parent8c066d5d78828c89783f60f97cf1da0949234a49 (diff)
downloadmeson-d7ee2ec7c0f2e69c4145a5db21aecbf602a344fb.zip
meson-d7ee2ec7c0f2e69c4145a5db21aecbf602a344fb.tar.gz
meson-d7ee2ec7c0f2e69c4145a5db21aecbf602a344fb.tar.bz2
Even more fixes.
-rw-r--r--mesonbuild/compilers/fortran.py8
-rw-r--r--mesonbuild/compilers/objc.py8
-rw-r--r--mesonbuild/compilers/objcpp.py8
-rw-r--r--mesonbuild/compilers/swift.py8
-rw-r--r--mesonbuild/compilers/vala.py6
-rwxr-xr-xrun_project_tests.py4
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<stdio.h>\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<stdio.h>\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: