summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-29 13:21:53 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-29 13:22:12 (GMT)
commit067a4f484b1e2f650918d90051653b5c434c77a2 (patch)
treee0d9e8dd16e4518988067865f3f922f13a512b71 /Source/cmGlobalNinjaGenerator.cxx
parent8b42d560028b8da0a3cf7e1a14962f2245d21227 (diff)
parent74829f01b13de0031e659bf8dac3e6672fbfa77b (diff)
downloadCMake-067a4f484b1e2f650918d90051653b5c434c77a2.zip
CMake-067a4f484b1e2f650918d90051653b5c434c77a2.tar.gz
CMake-067a4f484b1e2f650918d90051653b5c434c77a2.tar.bz2
Merge topic 'clang-gnulike-support'
74829f01b1 Help: Add notes for topic 'clang-gnulike-support' 19669abe1d Tests: handle string escaping differences with NMake+clang a2a90f41e3 Tests: require C++14 for the Tutorial 4819ff9647 Tests: fix failures with gnu mode clang on windows 26af0b25e7 cmake: use correct stack size with gnu mode clang on windows d44c0db0b2 clang: setup correct configuration in gnu mode b7d5ef23e9 cmGlobalNinjaGenerator: use gnu compatible paths with clang in gnu mode 3d0210d8dc binutils: add the llvm-* variants to the tool lists. ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Francesco Bertolaccini <francesco@bertolaccini.dev> Acked-by: Stanislav Ershov <digital.stream.of.mind@gmail.com> Acked-by: Saleem Abdulrasool <compnerd@compnerd.org> Merge-request: !2992
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index ea65a77..61dea80 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -639,13 +639,20 @@ void cmGlobalNinjaGenerator::EnableLanguage(
this->ResolveLanguageCompiler(l, mf, optional);
}
#ifdef _WIN32
- if ((mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID") != "MSVC") &&
- (mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID") != "MSVC") &&
- (mf->IsOn("CMAKE_COMPILER_IS_MINGW") ||
- (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "GNU") ||
- (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "GNU") ||
- (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "Clang") ||
- (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang"))) {
+ const bool clangGnuMode =
+ ((mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "Clang") &&
+ (mf->GetSafeDefinition("CMAKE_C_COMPILER_FRONTEND_VARIANT") == "GNU")) ||
+ ((mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang") &&
+ (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_FRONTEND_VARIANT") == "GNU"));
+
+ if (clangGnuMode ||
+ ((mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID") != "MSVC") &&
+ (mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID") != "MSVC") &&
+ (mf->IsOn("CMAKE_COMPILER_IS_MINGW") ||
+ (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "GNU") ||
+ (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "GNU") ||
+ (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "Clang") ||
+ (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang")))) {
this->UsingGCCOnWindows = true;
}
#endif