diff options
author | Thomas Herz <thomas.herz@kuka.com> | 2015-05-06 22:45:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-05-07 18:07:20 (GMT) |
commit | b3de0dfe93af769ee7420cd1380395d656b4dac9 (patch) | |
tree | f00d6b329039893f39d09775c2d73a8bc5cab3b7 /Source/cmGlobalNinjaGenerator.cxx | |
parent | 378c2a0e860f32e0435844d7d6af79a4fdc2b455 (diff) | |
download | CMake-b3de0dfe93af769ee7420cd1380395d656b4dac9.zip CMake-b3de0dfe93af769ee7420cd1380395d656b4dac9.tar.gz CMake-b3de0dfe93af769ee7420cd1380395d656b4dac9.tar.bz2 |
Ninja: Use forward slashes for any GCC on Windows (#15439)
Any GCC compiler on a Windows host needs forward slashes, not just
those built for MinGW.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 9894aa8..65e80e4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -96,7 +96,7 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string &path) { std::string result = path; #ifdef _WIN32 - if (this->IsMinGW()) + if (this->IsGCCOnWindows()) cmSystemTools::ReplaceString(result, "\\", "/"); else cmSystemTools::ReplaceString(result, "/", "\\"); @@ -484,7 +484,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator() , CompileCommandsStream(0) , Rules() , AllDependencies() - , UsingMinGW(false) + , UsingGCCOnWindows(false) , ComputingUnknownDependencies(false) , PolicyCMP0058(cmPolicies::WARN) { @@ -565,9 +565,13 @@ void cmGlobalNinjaGenerator this->ResolveLanguageCompiler(*l, mf, optional); } #ifdef _WIN32 - if (mf->IsOn("CMAKE_COMPILER_IS_MINGW")) + 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) { - this->UsingMinGW = true; + this->UsingGCCOnWindows = true; } #endif } |