diff options
author | Peter Kuemmel <syntheticpp@gmx.net> | 2012-06-08 20:01:57 (GMT) |
---|---|---|
committer | Peter Kuemmel <syntheticpp@gmx.net> | 2012-06-08 20:59:18 (GMT) |
commit | 941afa571c9f45c52bb935bad1c3b83fe415372e (patch) | |
tree | 85aeed7ac4e10f7404414d17316cf05670ed9516 /Source/cmNinjaTargetGenerator.cxx | |
parent | 033a687acd828ad6667d154939ffdbc482ab047f (diff) | |
download | CMake-941afa571c9f45c52bb935bad1c3b83fe415372e.zip CMake-941afa571c9f45c52bb935bad1c3b83fe415372e.tar.gz CMake-941afa571c9f45c52bb935bad1c3b83fe415372e.tar.bz2 |
Ninja: allow spaces in source path
And make /showIncude prefix visible for all build rules
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 6518727..75b3929 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -330,20 +330,14 @@ cmNinjaTargetGenerator vars.Defines = "$DEFINES"; vars.TargetPDB = "$TARGET_PDB"; - const char* cldeps = 0; - const char* showIncludePrefix = 0; - const char* cc = this->GetMakefile()->GetDefinition("CMAKE_C_COMPILER"); - if(cc && std::string(cc).find("cl.exe") != std::string::npos) - { - cldeps = this->GetMakefile()->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE"); - showIncludePrefix = this->GetMakefile()->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX"); - } + cmMakefile* mf = this->GetMakefile(); + const char* clDepsBinary = mf->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE"); + const char* clShowPrefix = mf->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX"); std::string depfile; std::string depfileFlagsName = "CMAKE_DEPFILE_FLAGS_" + language; - const char *depfileFlags = - this->GetMakefile()->GetDefinition(depfileFlagsName.c_str()); - if (depfileFlags || (cldeps && showIncludePrefix)) { + const char *depfileFlags = mf->GetDefinition(depfileFlagsName.c_str()); + if (depfileFlags || (clDepsBinary && clShowPrefix)) { std::string depfileFlagsStr = depfileFlags ? depfileFlags : ""; depfile = "$out.d"; cmSystemTools::ReplaceString(depfileFlagsStr, "<DEPFILE>", @@ -351,7 +345,7 @@ cmNinjaTargetGenerator cmSystemTools::ReplaceString(depfileFlagsStr, "<OBJECT>", "$out"); cmSystemTools::ReplaceString(depfileFlagsStr, "<CMAKE_C_COMPILER>", - this->GetMakefile()->GetDefinition("CMAKE_C_COMPILER")); + mf->GetDefinition("CMAKE_C_COMPILER")); flags += " " + depfileFlagsStr; } vars.Flags = flags.c_str(); @@ -361,8 +355,7 @@ cmNinjaTargetGenerator std::string compileCmdVar = "CMAKE_"; compileCmdVar += language; compileCmdVar += "_COMPILE_OBJECT"; - std::string compileCmd = - this->GetMakefile()->GetRequiredDefinition(compileCmdVar.c_str()); + std::string compileCmd = mf->GetRequiredDefinition(compileCmdVar.c_str()); std::vector<std::string> compileCmds; cmSystemTools::ExpandListArgument(compileCmd, compileCmds); @@ -373,10 +366,10 @@ cmNinjaTargetGenerator std::string cmdLine = this->GetLocalGenerator()->BuildCommandLine(compileCmds); - if(cldeps && showIncludePrefix) + if(clDepsBinary && clShowPrefix) { - std::string prefix = showIncludePrefix; - cmdLine = std::string(cldeps) + " $in $out.d $out " + "\"" + prefix + "\" " + cmdLine; + std::string prefix = clShowPrefix; + cmdLine = "\"" + std::string(clDepsBinary) + "\" $in $out.d $out \"" + prefix + "\" " + cmdLine; } // Write the rule for compiling file of the given language. |