summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorPeter Kümmel <syntheticpp@gmx.net>2012-08-17 08:56:31 (GMT)
committerPeter Kümmel <syntheticpp@gmx.net>2012-08-17 09:05:47 (GMT)
commit3632f24f1320deed85b574f016bcf7ad0e9f5df5 (patch)
treebcd8f57d8a2e886bfad6c239ce746f87a174f90c /Source/cmNinjaTargetGenerator.cxx
parent186e9bdc22256039948338d91ab3be02893ab17a (diff)
downloadCMake-3632f24f1320deed85b574f016bcf7ad0e9f5df5.zip
CMake-3632f24f1320deed85b574f016bcf7ad0e9f5df5.tar.gz
CMake-3632f24f1320deed85b574f016bcf7ad0e9f5df5.tar.bz2
Ninja: cmcldeps needs a compiler
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 3532c8b..793dfa0 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -354,7 +354,9 @@ cmNinjaTargetGenerator
// TODO but why doesn't it work with cmcldeps?
const std::string projectName = mf->GetProjectName() ?
mf->GetProjectName() : "";
- if (projectName != "CMAKE_TRY_COMPILE")
+ if (projectName != "CMAKE_TRY_COMPILE"
+ && (mf->GetDefinition("CMAKE_C_COMPILER") ||
+ mf->GetDefinition("CMAKE_CXX_COMPILER")))
{
useClDeps = true;
std::string qu = "\"";
@@ -399,9 +401,10 @@ cmNinjaTargetGenerator
if(useClDeps)
{
std::string cl = mf->GetDefinition("CMAKE_C_COMPILER");
- cl = "\"" + cl + "\" ";
- cmdLine = clDepsBinary + " " + lang + " $in \"$DEP_FILE\" $out "
- + clShowPrefix + " " + cl + cmdLine;
+ if (cl.empty())
+ cl = mf->GetDefinition("CMAKE_CXX_COMPILER");
+ cmdLine = clDepsBinary + " " + lang + " $in \"$DEP_FILE\" $out "
+ + clShowPrefix + " \"" + cl + "\" " + cmdLine;
}
// Write the rule for compiling file of the given language.