From b7d5ef23e9c9c76c7b8422c969ce806f9fd965e6 Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Wed, 20 Feb 2019 12:18:15 +0100 Subject: cmGlobalNinjaGenerator: use gnu compatible paths with clang in gnu mode --- Source/cmGlobalNinjaGenerator.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 00276f8..b642e46 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 -- cgit v0.12