Commit de16ff3e authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'ninja-mingw'

6a2f8335 Ninja: Fix escaping of path to depfile
781eb380

 Tests: Fix VSResource test on MinGW with Ninja and a space in the path
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !911
parents 47281310 6a2f8335
Pipeline #60638 passed with stage
in 0 seconds
......@@ -146,13 +146,6 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path)
return EncodeLiteral(result);
}
std::string cmGlobalNinjaGenerator::EncodeDepfileSpace(const std::string& path)
{
std::string result = path;
cmSystemTools::ReplaceString(result, " ", "\\ ");
return result;
}
void cmGlobalNinjaGenerator::WriteBuild(
std::ostream& os, const std::string& comment, const std::string& rule,
const cmNinjaDeps& outputs, const cmNinjaDeps& implicitOuts,
......
......@@ -75,7 +75,6 @@ public:
static std::string EncodeIdent(const std::string& ident, std::ostream& vars);
static std::string EncodeLiteral(const std::string& lit);
std::string EncodePath(const std::string& path);
static std::string EncodeDepfileSpace(const std::string& path);
cmLinkLineComputer* CreateLinkLineComputer(
cmOutputConverter* outputConverter,
......
......@@ -822,8 +822,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
vars["DEFINES"] = this->ComputeDefines(source, language);
vars["INCLUDES"] = this->GetIncludes(language);
if (!this->NeedDepTypeMSVC(language)) {
vars["DEP_FILE"] =
cmGlobalNinjaGenerator::EncodeDepfileSpace(objectFileName + ".d");
vars["DEP_FILE"] = this->GetLocalGenerator()->ConvertToOutputFormat(
objectFileName + ".d", cmOutputConverter::SHELL);
}
this->ExportObjectCompileCommand(
......@@ -920,8 +920,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
vars["INCLUDES"] = sourceDirectoryFlag + " " + vars["INCLUDES"];
// Explicit preprocessing always uses a depfile.
ppVars["DEP_FILE"] =
cmGlobalNinjaGenerator::EncodeDepfileSpace(ppFileName + ".d");
ppVars["DEP_FILE"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ppFileName + ".d", cmOutputConverter::SHELL);
// The actual compilation does not need a depfile because it
// depends on the already-preprocessed source.
vars.erase("DEP_FILE");
......
......@@ -18,9 +18,8 @@ if(CMAKE_RC_COMPILER MATCHES windres)
message(STATUS "CMAKE_RC_COMPILER MATCHES windres")
add_definitions(/DCMAKE_RCDEFINE=test.txt)
add_definitions(/DCMAKE_RCDEFINE_NO_QUOTED_STRINGS)
if(MSYS AND CMAKE_CURRENT_BINARY_DIR MATCHES " ")
# windres cannot handle spaces in include dir, and
# for the MSys shell we do not convert to shortpath.
if(CMAKE_CURRENT_BINARY_DIR MATCHES " ")
# windres cannot handle spaces in include dir
set(CMAKE_RC_NO_INCLUDE 1)
endif()
elseif(MSVC60)
......
Supports Markdown
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