summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2012-06-09 11:52:20 (GMT)
committerPeter Kuemmel <syntheticpp@gmx.net>2012-06-09 12:12:11 (GMT)
commitdb607dea8dbb0d16e75e5ae1e764002e4ce8e605 (patch)
tree04cbcb2e2f9e33c5b2d4013992c2364590ac7ae4 /Source/cmNinjaTargetGenerator.cxx
parent7553a3799a188594ee0bda46b18095479e3ee54b (diff)
downloadCMake-db607dea8dbb0d16e75e5ae1e764002e4ce8e605.zip
CMake-db607dea8dbb0d16e75e5ae1e764002e4ce8e605.tar.gz
CMake-db607dea8dbb0d16e75e5ae1e764002e4ce8e605.tar.bz2
Ninja: don't use cmcldeps for try_compile
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 75b3929..40fdc8b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -331,13 +331,25 @@ cmNinjaTargetGenerator
vars.TargetPDB = "$TARGET_PDB";
cmMakefile* mf = this->GetMakefile();
+ bool useClDeps = false;
const char* clDepsBinary = mf->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
const char* clShowPrefix = mf->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX");
+ const char* projectName = mf->GetProjectName();
+ if (clDepsBinary && clShowPrefix)
+ {
+ useClDeps = true;
+ if (projectName && std::string(projectName) == "CMAKE_TRY_COMPILE")
+ {
+ // don't wrap for try_compile, TODO but why doesn't it work with cmcldeps?
+ useClDeps = false;
+ }
+ }
+
std::string depfile;
std::string depfileFlagsName = "CMAKE_DEPFILE_FLAGS_" + language;
const char *depfileFlags = mf->GetDefinition(depfileFlagsName.c_str());
- if (depfileFlags || (clDepsBinary && clShowPrefix)) {
+ if (depfileFlags || useClDeps) {
std::string depfileFlagsStr = depfileFlags ? depfileFlags : "";
depfile = "$out.d";
cmSystemTools::ReplaceString(depfileFlagsStr, "<DEPFILE>",
@@ -366,7 +378,7 @@ cmNinjaTargetGenerator
std::string cmdLine =
this->GetLocalGenerator()->BuildCommandLine(compileCmds);
- if(clDepsBinary && clShowPrefix)
+ if(useClDeps)
{
std::string prefix = clShowPrefix;
cmdLine = "\"" + std::string(clDepsBinary) + "\" $in $out.d $out \"" + prefix + "\" " + cmdLine;