diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2012-08-17 08:56:31 (GMT) |
---|---|---|
committer | Peter Kümmel <syntheticpp@gmx.net> | 2012-08-17 09:05:47 (GMT) |
commit | 3632f24f1320deed85b574f016bcf7ad0e9f5df5 (patch) | |
tree | bcd8f57d8a2e886bfad6c239ce746f87a174f90c /Source/cmNinjaTargetGenerator.cxx | |
parent | 186e9bdc22256039948338d91ab3be02893ab17a (diff) | |
download | CMake-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.cxx | 11 |
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. |