summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-05-23 16:08:23 (GMT)
committerStephen Kelly <steveire@gmail.com>2012-06-04 21:42:37 (GMT)
commitfbaddf4e403af327d263e347e666396a08fbdd10 (patch)
tree34dfd1d8013b3c75d1877cceec45aeaaf8402215
parentdb839bec7d076b54c5e9ad0d19386a26557a509e (diff)
downloadCMake-fbaddf4e403af327d263e347e666396a08fbdd10.zip
CMake-fbaddf4e403af327d263e347e666396a08fbdd10.tar.gz
CMake-fbaddf4e403af327d263e347e666396a08fbdd10.tar.bz2
Escape the source file to be compiled if required.
Whitespaces in paths can otherwise cause invalid command lines to be generated.
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 7c58154..e419a4d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -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();