summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2012-06-13 15:14:16 (GMT)
committerPeter Kuemmel <syntheticpp@gmx.net>2012-06-13 15:14:16 (GMT)
commit54a388beaaec8b9a4e4bb6bfb220d5711a866866 (patch)
tree1007b6483e9afbd43d5dc212768d4b8909de899c /Source/cmNinjaTargetGenerator.cxx
parent43200c145d9690701f0cc6dbd5c60ee3ece5edf8 (diff)
downloadCMake-54a388beaaec8b9a4e4bb6bfb220d5711a866866.zip
CMake-54a388beaaec8b9a4e4bb6bfb220d5711a866866.tar.gz
CMake-54a388beaaec8b9a4e4bb6bfb220d5711a866866.tar.bz2
Ninja: extract dependencies for .rc files with msvc tools
rc.exe doesn't support /showIncludes. Because .rc files also #include stuff we can misuse cl.exe to get the included files. Done one the fly by cmcldeps.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index ce1aac2..f76bc0b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -339,7 +339,7 @@ cmNinjaTargetGenerator
bool useClDeps = false;
std::string clDepsBinary;
std::string clShowPrefix;
- if (lang == "C" || lang == "CXX")
+ if (lang == "C" || lang == "CXX" || lang == "RC")
{
const char* depsPtr = mf->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
const char* showPtr = mf->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX");
@@ -352,8 +352,9 @@ cmNinjaTargetGenerator
if (projectName != "CMAKE_TRY_COMPILE")
{
useClDeps = true;
- clDepsBinary = depsPtr;
- clShowPrefix = showPtr;
+ std::string qu = "\"";
+ clDepsBinary = qu + depsPtr + qu;
+ clShowPrefix = qu + showPtr + qu;
vars.DependencyFile = "$DEP_FILE";
}
}
@@ -392,8 +393,10 @@ cmNinjaTargetGenerator
if(useClDeps)
{
- cmdLine = "\"" + clDepsBinary + "\" $in \"$DEP_FILE\" $out \""
- + clShowPrefix + "\" " + cmdLine;
+ std::string cl = mf->GetDefinition("CMAKE_C_COMPILER");
+ cl = "\"" + cl + "\" ";
+ cmdLine = clDepsBinary + " " + lang + " $in \"$DEP_FILE\" $out "
+ + clShowPrefix + " " + cl + cmdLine;
}
// Write the rule for compiling file of the given language.