cmGlobalNinjaGenerator: escape : in module names

Not all filesystems support `:` in the name, so replace it with `-`. As
`-` is not otherwise allowed in module names anyways, there is no risk
of conflict.
This commit is contained in:
Ben Boeckel
2022-04-19 11:00:42 -04:00
parent 499009b79c
commit 97a68198c9

View File

@@ -2550,7 +2550,9 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
}
} else {
// Assume the module file path matches the logical module name.
mod = cmStrCat(module_dir, p.LogicalName);
std::string safe_logical_name = p.LogicalName;
cmSystemTools::ReplaceString(safe_logical_name, ":", "-");
mod = cmStrCat(module_dir, safe_logical_name);
}
mod_files[p.LogicalName] = mod;
tm[p.LogicalName] = mod;