diff options
author | Brad King <brad.king@kitware.com> | 2021-09-21 15:00:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-09-21 15:01:18 (GMT) |
commit | bcdd8cfe441c45dd1c9f0617c6652eb30386e7c2 (patch) | |
tree | b9c83213cff1244783b2fde6638cf8582b48a07f /Source/cmGlobalNinjaGenerator.cxx | |
parent | 6261210a671aa20d691b816df6a2237777995b06 (diff) | |
parent | a136b6ec986b3e69184d7b07997d81a7cdd720dd (diff) | |
download | CMake-bcdd8cfe441c45dd1c9f0617c6652eb30386e7c2.zip CMake-bcdd8cfe441c45dd1c9f0617c6652eb30386e7c2.tar.gz CMake-bcdd8cfe441c45dd1c9f0617c6652eb30386e7c2.tar.bz2 |
Merge topic 'platform-vars'
a136b6ec98 MINGW: Define variable only when targeting Windows platforms
39c5dad0cb Ninja: Remove redundant check for GNU-like compiler on Windows
0b7ae84a96 Cygwin: Remove redundant definitions of CYGWIN and UNIX variables
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6538
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 6279d68..768c045 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -928,29 +928,21 @@ void cmGlobalNinjaGenerator::EnableLanguage( continue; } this->ResolveLanguageCompiler(l, mf, optional); - } #ifdef _WIN32 - 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") || - (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "ARMClang") || - (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "ARMClang") || - (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "QCC") || - (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "QCC")))) { - this->UsingGCCOnWindows = true; - } + std::string const& compilerId = + mf->GetSafeDefinition(cmStrCat("CMAKE_", l, "_COMPILER_ID")); + std::string const& simulateId = + mf->GetSafeDefinition(cmStrCat("CMAKE_", l, "_SIMULATE_ID")); + std::string const& compilerFrontendVariant = mf->GetSafeDefinition( + cmStrCat("CMAKE_", l, "_COMPILER_FRONTEND_VARIANT")); + if ((compilerId == "Clang" && compilerFrontendVariant == "GNU") || + (simulateId != "MSVC" && + (compilerId == "GNU" || compilerId == "QCC" || + cmHasLiteralSuffix(compilerId, "Clang")))) { + this->UsingGCCOnWindows = true; + } #endif + } } // Implemented by: |