Browse Source

Merge topic 'mingw-slashes'

a67cd9c39c Ninja: Restore slash style for MinGW tools when extra languages are enabled

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !8368
Brad King 2 years ago
parent
commit
0b2b89cd93
2 changed files with 7 additions and 5 deletions
  1. 6 4
      Source/cmGlobalNinjaGenerator.cxx
  2. 1 1
      Source/cmGlobalNinjaGenerator.h

+ 6 - 4
Source/cmGlobalNinjaGenerator.cxx

@@ -949,8 +949,9 @@ void cmGlobalNinjaGenerator::EnableLanguage(
       mf->GetSafeDefinition(cmStrCat("CMAKE_", l, "_SIMULATE_ID"));
     std::string const& compilerFrontendVariant = mf->GetSafeDefinition(
       cmStrCat("CMAKE_", l, "_COMPILER_FRONTEND_VARIANT"));
-    this->SetUsingGCCOnWindows(
-      DetectGCCOnWindows(compilerId, simulateId, compilerFrontendVariant));
+    if (DetectGCCOnWindows(compilerId, simulateId, compilerFrontendVariant)) {
+      this->MarkAsGCCOnWindows();
+    }
 #endif
   }
 }
@@ -2843,8 +2844,9 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
   cmGlobalNinjaGenerator& gg =
     cm::static_reference_cast<cmGlobalNinjaGenerator>(ggd);
 #  ifdef _WIN32
-  gg.SetUsingGCCOnWindows(
-    DetectGCCOnWindows(compilerId, simulateId, compilerFrontendVariant));
+  if (DetectGCCOnWindows(compilerId, simulateId, compilerFrontendVariant)) {
+    gg.MarkAsGCCOnWindows();
+  }
 #  endif
   return gg.WriteDyndepFile(dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld,
                             arg_dd, arg_ddis, module_dir, linked_target_dirs,

+ 1 - 1
Source/cmGlobalNinjaGenerator.h

@@ -169,7 +169,7 @@ public:
                            const std::string& comment = "");
 
   bool IsGCCOnWindows() const { return this->UsingGCCOnWindows; }
-  void SetUsingGCCOnWindows(bool b) { this->UsingGCCOnWindows = b; }
+  void MarkAsGCCOnWindows() { this->UsingGCCOnWindows = true; }
 
   cmGlobalNinjaGenerator(cmake* cm);