mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-13 02:29:02 -06:00
Ninja: Restore slash style for MinGW tools when extra languages are enabled
Since commit f3ca199c9b (cmGlobalNinjaGenerator: Factor out GNU-like
command-line detection on Windows, 2023-03-18, v3.26.1~2^2~6), we
accidentally "unrecognize" MinGW tools on Windows if a language other
than C or CXX is enabled. This causes the wrong slash style to be
generated in paths in `build.ninja`.
Fixes: #24642
This commit is contained in:
@@ -956,8 +956,9 @@ void cmGlobalNinjaGenerator::EnableLanguage(
|
|||||||
mf->GetSafeDefinition(cmStrCat("CMAKE_", l, "_SIMULATE_ID"));
|
mf->GetSafeDefinition(cmStrCat("CMAKE_", l, "_SIMULATE_ID"));
|
||||||
std::string const& compilerFrontendVariant = mf->GetSafeDefinition(
|
std::string const& compilerFrontendVariant = mf->GetSafeDefinition(
|
||||||
cmStrCat("CMAKE_", l, "_COMPILER_FRONTEND_VARIANT"));
|
cmStrCat("CMAKE_", l, "_COMPILER_FRONTEND_VARIANT"));
|
||||||
this->SetUsingGCCOnWindows(
|
if (DetectGCCOnWindows(compilerId, simulateId, compilerFrontendVariant)) {
|
||||||
DetectGCCOnWindows(compilerId, simulateId, compilerFrontendVariant));
|
this->MarkAsGCCOnWindows();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2843,8 +2844,9 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
|
|||||||
cmGlobalNinjaGenerator& gg =
|
cmGlobalNinjaGenerator& gg =
|
||||||
cm::static_reference_cast<cmGlobalNinjaGenerator>(ggd);
|
cm::static_reference_cast<cmGlobalNinjaGenerator>(ggd);
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
gg.SetUsingGCCOnWindows(
|
if (DetectGCCOnWindows(compilerId, simulateId, compilerFrontendVariant)) {
|
||||||
DetectGCCOnWindows(compilerId, simulateId, compilerFrontendVariant));
|
gg.MarkAsGCCOnWindows();
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
return gg.WriteDyndepFile(dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld,
|
return gg.WriteDyndepFile(dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld,
|
||||||
arg_dd, arg_ddis, module_dir, linked_target_dirs,
|
arg_dd, arg_ddis, module_dir, linked_target_dirs,
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ public:
|
|||||||
const std::string& comment = "");
|
const std::string& comment = "");
|
||||||
|
|
||||||
bool IsGCCOnWindows() const { return this->UsingGCCOnWindows; }
|
bool IsGCCOnWindows() const { return this->UsingGCCOnWindows; }
|
||||||
void SetUsingGCCOnWindows(bool b) { this->UsingGCCOnWindows = b; }
|
void MarkAsGCCOnWindows() { this->UsingGCCOnWindows = true; }
|
||||||
|
|
||||||
cmGlobalNinjaGenerator(cmake* cm);
|
cmGlobalNinjaGenerator(cmake* cm);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user