Commit 6a2f8335 authored by Brad King's avatar Brad King
Browse files

Ninja: Fix escaping of path to depfile

Replace the dedicated and non-portable escaping code with use of our
standard escaping logic.
parent 781eb380
...@@ -146,13 +146,6 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) ...@@ -146,13 +146,6 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path)
return EncodeLiteral(result); return EncodeLiteral(result);
} }
std::string cmGlobalNinjaGenerator::EncodeDepfileSpace(const std::string& path)
{
std::string result = path;
cmSystemTools::ReplaceString(result, " ", "\\ ");
return result;
}
void cmGlobalNinjaGenerator::WriteBuild( void cmGlobalNinjaGenerator::WriteBuild(
std::ostream& os, const std::string& comment, const std::string& rule, std::ostream& os, const std::string& comment, const std::string& rule,
const cmNinjaDeps& outputs, const cmNinjaDeps& implicitOuts, const cmNinjaDeps& outputs, const cmNinjaDeps& implicitOuts,
......
...@@ -75,7 +75,6 @@ public: ...@@ -75,7 +75,6 @@ public:
static std::string EncodeIdent(const std::string& ident, std::ostream& vars); static std::string EncodeIdent(const std::string& ident, std::ostream& vars);
static std::string EncodeLiteral(const std::string& lit); static std::string EncodeLiteral(const std::string& lit);
std::string EncodePath(const std::string& path); std::string EncodePath(const std::string& path);
static std::string EncodeDepfileSpace(const std::string& path);
cmLinkLineComputer* CreateLinkLineComputer( cmLinkLineComputer* CreateLinkLineComputer(
cmOutputConverter* outputConverter, cmOutputConverter* outputConverter,
......
...@@ -822,8 +822,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( ...@@ -822,8 +822,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
vars["DEFINES"] = this->ComputeDefines(source, language); vars["DEFINES"] = this->ComputeDefines(source, language);
vars["INCLUDES"] = this->GetIncludes(language); vars["INCLUDES"] = this->GetIncludes(language);
if (!this->NeedDepTypeMSVC(language)) { if (!this->NeedDepTypeMSVC(language)) {
vars["DEP_FILE"] = vars["DEP_FILE"] = this->GetLocalGenerator()->ConvertToOutputFormat(
cmGlobalNinjaGenerator::EncodeDepfileSpace(objectFileName + ".d"); objectFileName + ".d", cmOutputConverter::SHELL);
} }
this->ExportObjectCompileCommand( this->ExportObjectCompileCommand(
...@@ -920,8 +920,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( ...@@ -920,8 +920,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
vars["INCLUDES"] = sourceDirectoryFlag + " " + vars["INCLUDES"]; vars["INCLUDES"] = sourceDirectoryFlag + " " + vars["INCLUDES"];
// Explicit preprocessing always uses a depfile. // Explicit preprocessing always uses a depfile.
ppVars["DEP_FILE"] = ppVars["DEP_FILE"] = this->GetLocalGenerator()->ConvertToOutputFormat(
cmGlobalNinjaGenerator::EncodeDepfileSpace(ppFileName + ".d"); ppFileName + ".d", cmOutputConverter::SHELL);
// The actual compilation does not need a depfile because it // The actual compilation does not need a depfile because it
// depends on the already-preprocessed source. // depends on the already-preprocessed source.
vars.erase("DEP_FILE"); vars.erase("DEP_FILE");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment