From 3632f24f1320deed85b574f016bcf7ad0e9f5df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Fri, 17 Aug 2012 10:56:31 +0200 Subject: Ninja: cmcldeps needs a compiler --- Source/cmNinjaTargetGenerator.cxx | 11 +++++++---- 1 file 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. -- cgit v0.12