Escape the source file to be compiled if required.

Whitespaces in paths can otherwise cause invalid command lines to
be generated.
This commit is contained in:
Stephen Kelly 2012-05-23 18:08:23 +02:00
parent db839bec7d
commit fbaddf4e40
1 changed files with 4 additions and 1 deletions

View File

@ -492,7 +492,10 @@ cmNinjaTargetGenerator
cmLocalGenerator::RuleVariables compileObjectVars;
std::string lang = language;
compileObjectVars.Language = lang.c_str();
compileObjectVars.Source = sourceFileName.c_str();
std::string escapedSourceFileName =
this->LocalGenerator->ConvertToOutputFormat(
sourceFileName.c_str(), cmLocalGenerator::SHELL);
compileObjectVars.Source = escapedSourceFileName.c_str();
compileObjectVars.Object = objectFileName.c_str();
compileObjectVars.Flags = vars["FLAGS"].c_str();
compileObjectVars.Defines = vars["DEFINES"].c_str();