diff options
author | Peter Kuemmel <syntheticpp@gmx.net> | 2012-06-07 21:34:48 (GMT) |
---|---|---|
committer | Peter Kuemmel <syntheticpp@gmx.net> | 2012-06-07 21:34:48 (GMT) |
commit | 1d40729eaa35dd643efdf5e793e6a541e890f33a (patch) | |
tree | 71804fd987618c253ee73e54b600c82aea740eeb /Source | |
parent | e3a1f727f75e6077e7724719c606d833e8bbd9b0 (diff) | |
download | CMake-1d40729eaa35dd643efdf5e793e6a541e890f33a.zip CMake-1d40729eaa35dd643efdf5e793e6a541e890f33a.tar.gz CMake-1d40729eaa35dd643efdf5e793e6a541e890f33a.tar.bz2 |
Ninja: add dependency tracking for msvc with cldeps
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index e419a4d..74b5c92 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -330,12 +330,17 @@ cmNinjaTargetGenerator vars.Defines = "$DEFINES"; vars.TargetPDB = "$TARGET_PDB"; + bool cldeps = false; + const char* cc = this->GetMakefile()->GetDefinition("CMAKE_C_COMPILER"); + if(cc && std::string(cc).find("cl.exe") != std::string::npos) + cldeps = true; + std::string depfile; std::string depfileFlagsName = "CMAKE_DEPFILE_FLAGS_" + language; const char *depfileFlags = this->GetMakefile()->GetDefinition(depfileFlagsName.c_str()); - if (depfileFlags) { - std::string depfileFlagsStr = depfileFlags; + if (depfileFlags || cldeps) { + std::string depfileFlagsStr = depfileFlags ? depfileFlags : ""; depfile = "$out.d"; cmSystemTools::ReplaceString(depfileFlagsStr, "<DEPFILE>", depfile.c_str()); @@ -364,6 +369,9 @@ cmNinjaTargetGenerator std::string cmdLine = this->GetLocalGenerator()->BuildCommandLine(compileCmds); + if(cldeps) + cmdLine = "cldeps.exe $out.d $out " + cmdLine; + // Write the rule for compiling file of the given language. std::ostringstream comment; comment << "Rule for compiling " << language << " files."; |