diff options
author | Brad King <brad.king@kitware.com> | 2023-03-18 15:21:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-18 15:52:42 (GMT) |
commit | 60132272302f106c996aa15a0c42cb3de9789a24 (patch) | |
tree | 9ae43141a69d4fbd104d15eb7c58b882c1ddc1cf /Source/cmGlobalNinjaGenerator.cxx | |
parent | d9d74b5e8a66222c40b343f95cb31a00636ecc6a (diff) | |
download | CMake-60132272302f106c996aa15a0c42cb3de9789a24.zip CMake-60132272302f106c996aa15a0c42cb3de9789a24.tar.gz CMake-60132272302f106c996aa15a0c42cb3de9789a24.tar.bz2 |
cmGlobalNinjaGenerator: Use forward slashes in clang modmap format on Windows
Issue: #24611
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 4b894c7..914d1c7 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2639,7 +2639,13 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( CxxModuleLocations locs; locs.RootDirectory = "."; locs.PathForGenerator = [this](std::string path) -> std::string { - return this->ConvertToNinjaPath(path); + path = this->ConvertToNinjaPath(path); +# ifdef _WIN32 + if (this->IsGCCOnWindows()) { + std::replace(path.begin(), path.end(), '\\', '/'); + } +# endif + return path; }; locs.BmiLocationForModule = [&mod_files](std::string const& logical) -> cm::optional<std::string> { |