aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2019-04-11 22:34:08 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2019-04-15 12:07:17 +0100
commit050b7d8584d2e22b0131b6a5728c842006054167 (patch)
treefa680e9c3bdc0b7d7714ae468f673d49452f31f9 /mesonbuild/environment.py
parentdf0be82dd6581d02d2e5a6d706a26113b35b98d5 (diff)
downloadmeson-050b7d8584d2e22b0131b6a5728c842006054167.zip
meson-050b7d8584d2e22b0131b6a5728c842006054167.tar.gz
meson-050b7d8584d2e22b0131b6a5728c842006054167.tar.bz2
Note when clang objc/objc++ compiler is Windows targeted
When using clang as an objc/objc++ compiler, identify if it's a Windows targeted compiler, so that GnuLikeCompiler::get_pic_args() doesn't use '-fPIC', which clang considers an error for the Window target. Future work: Factor out parsing the clang target string from the detectors for various languages.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index b512df9..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)