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>
This commit is contained in:
Brad King 2016-08-04 09:41:10 -04:00
parent 2c0e87fff3
commit e555480c60
1 changed files with 7 additions and 5 deletions

View File

@ -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