diff options
author | Brad King <brad.king@kitware.com> | 2016-08-04 13:41:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-04 13:44:56 (GMT) |
commit | e555480c60e95073840fe1a5f52004fd8ce81f9c (patch) | |
tree | 9083b8fcf2f281b3d7460ca0835b05a18d78b27d | |
parent | 2c0e87fff3347189db7454cf55669eec45819d9a (diff) | |
download | CMake-e555480c60e95073840fe1a5f52004fd8ce81f9c.zip CMake-e555480c60e95073840fe1a5f52004fd8ce81f9c.tar.gz CMake-e555480c60e95073840fe1a5f52004fd8ce81f9c.tar.bz2 |
Ninja: Fix response file format for GNU-like Clang on Windows
The `CMAKE_<LANG>_SIMULATE_ID` variables are not set to "GNU" for a
GNU-like Clang compiler on Windows. They are only set to "MSVC" for a
MSVC-like Clang. Revise our response file format selection accordingly.
Reported-by: Chaoren Lin <chaorenl@google.com>
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 51175c7..44418f2 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -554,11 +554,13 @@ void cmGlobalNinjaGenerator::EnableLanguage( this->ResolveLanguageCompiler(*l, mf, optional); } #ifdef _WIN32 - if (mf->IsOn("CMAKE_COMPILER_IS_MINGW") || - strcmp(mf->GetSafeDefinition("CMAKE_C_COMPILER_ID"), "GNU") == 0 || - strcmp(mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"), "GNU") == 0 || - strcmp(mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID"), "GNU") == 0 || - strcmp(mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"), "GNU") == 0) { + if (strcmp(mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID"), "MSVC") != 0 && + strcmp(mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"), "MSVC") != 0 && + (mf->IsOn("CMAKE_COMPILER_IS_MINGW") || + strcmp(mf->GetSafeDefinition("CMAKE_C_COMPILER_ID"), "GNU") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"), "GNU") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_C_COMPILER_ID"), "Clang") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"), "Clang") == 0)) { this->UsingGCCOnWindows = true; } #endif |