aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-04-20 14:36:16 +0300
committerGitHub <noreply@github.com>2019-04-20 14:36:16 +0300
commitce160e1eab303eb2c876862d948497c0c10ef33a (patch)
treea0c0d433122aee10fa4f39ec8372feb6feb03677 /mesonbuild/environment.py
parent5c85b5028080e74b3a74f9e0d63166c3c3ca15e6 (diff)
parent744ca13ddb69da337bc19ac0461b769f6f23cfad (diff)
downloadmeson-ce160e1eab303eb2c876862d948497c0c10ef33a.zip
meson-ce160e1eab303eb2c876862d948497c0c10ef33a.tar.gz
meson-ce160e1eab303eb2c876862d948497c0c10ef33a.tar.bz2
Merge pull request #5250 from jon-turney/test-compiler-report
Add a report of compilers used to run_project_tests.py
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py68
1 files changed, 25 insertions, 43 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 2241089..f85decd 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -921,6 +921,8 @@ class Environment:
return GnuObjCCompiler(ccache + compiler, version, compiler_type, is_cross, exe_wrap, defines)
if out.startswith('Apple LLVM'):
return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_OSX, is_cross, exe_wrap)
+ if 'windows' in out:
+ return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_MINGW, is_cross, exe_wrap)
if out.startswith(('clang', 'OpenBSD clang')):
return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_STANDARD, is_cross, exe_wrap)
self._handle_exceptions(popen_exceptions, compilers)
@@ -948,6 +950,8 @@ class Environment:
return GnuObjCPPCompiler(ccache + compiler, version, compiler_type, is_cross, exe_wrap, defines)
if out.startswith('Apple LLVM'):
return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_OSX, is_cross, exe_wrap)
+ if 'windows' in out:
+ return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_MINGW, is_cross, exe_wrap)
if out.startswith(('clang', 'OpenBSD clang')):
return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_STANDARD, is_cross, exe_wrap)
self._handle_exceptions(popen_exceptions, compilers)
@@ -1084,65 +1088,43 @@ class Environment:
return compilers.SwiftCompiler(exelist, version)
raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')
- def compilers_from_language(self, lang: str, need_cross_compiler: bool):
- comp = None
- cross_comp = None
+ def compiler_from_language(self, lang: str, want_cross: bool):
if lang == 'c':
- comp = self.detect_c_compiler(False)
- if need_cross_compiler:
- cross_comp = self.detect_c_compiler(True)
+ comp = self.detect_c_compiler(want_cross)
elif lang == 'cpp':
- comp = self.detect_cpp_compiler(False)
- if need_cross_compiler:
- cross_comp = self.detect_cpp_compiler(True)
+ comp = self.detect_cpp_compiler(want_cross)
elif lang == 'objc':
- comp = self.detect_objc_compiler(False)
- if need_cross_compiler:
- cross_comp = self.detect_objc_compiler(True)
+ comp = self.detect_objc_compiler(want_cross)
elif lang == 'cuda':
- comp = self.detect_cuda_compiler(False)
- if need_cross_compiler:
- cross_comp = self.detect_cuda_compiler(True)
+ comp = self.detect_cuda_compiler(want_cross)
elif lang == 'objcpp':
- comp = self.detect_objcpp_compiler(False)
- if need_cross_compiler:
- cross_comp = self.detect_objcpp_compiler(True)
+ comp = self.detect_objcpp_compiler(want_cross)
elif lang == 'java':
- comp = self.detect_java_compiler()
- if need_cross_compiler:
- cross_comp = comp # Java is platform independent.
+ comp = self.detect_java_compiler() # Java is platform independent.
elif lang == 'cs':
- comp = self.detect_cs_compiler()
- if need_cross_compiler:
- cross_comp = comp # C# is platform independent.
+ comp = self.detect_cs_compiler() # C# is platform independent.
elif lang == 'vala':
- comp = self.detect_vala_compiler()
- if need_cross_compiler:
- cross_comp = comp # Vala compiles to platform-independent C
+ comp = self.detect_vala_compiler() # Vala compiles to platform-independent C
elif lang == 'd':
- comp = self.detect_d_compiler(False)
- if need_cross_compiler:
- cross_comp = self.detect_d_compiler(True)
+ comp = self.detect_d_compiler(want_cross)
elif lang == 'rust':
- comp = self.detect_rust_compiler(False)
- if need_cross_compiler:
- cross_comp = self.detect_rust_compiler(True)
+ comp = self.detect_rust_compiler(want_cross)
elif lang == 'fortran':
- comp = self.detect_fortran_compiler(False)
- if need_cross_compiler:
- cross_comp = self.detect_fortran_compiler(True)
+ comp = self.detect_fortran_compiler(want_cross)
elif lang == 'swift':
- comp = self.detect_swift_compiler()
- if need_cross_compiler:
+ if want_cross:
raise EnvironmentException('Cross compilation with Swift is not working yet.')
- # cross_comp = self.environment.detect_fortran_compiler(True)
+ comp = self.detect_swift_compiler()
else:
- return None, None
-
- return comp, cross_comp
+ comp = None
+ return comp
def detect_compilers(self, lang: str, need_cross_compiler: bool):
- (comp, cross_comp) = self.compilers_from_language(lang, need_cross_compiler)
+ comp = self.compiler_from_language(lang, False)
+ if need_cross_compiler:
+ cross_comp = self.compiler_from_language(lang, True)
+ else:
+ cross_comp = None
if comp is not None:
self.coredata.process_new_compilers(lang, comp, cross_comp, self)
return comp, cross_comp