[Cmake-commits] CMake branch, next, updated. v2.8.8-3138-g54449c1
Peter Kuemmel
syntheticpp at gmx.net
Tue Jun 12 19:00:17 EDT 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 54449c11d0b779b62178e71136cc013771078931 (commit)
via 43200c145d9690701f0cc6dbd5c60ee3ece5edf8 (commit)
from 9267a6a1cdeea5b8847c903e114334280d6bb90c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54449c11d0b779b62178e71136cc013771078931
commit 54449c11d0b779b62178e71136cc013771078931
Merge: 9267a6a 43200c1
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Tue Jun 12 19:00:14 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 12 19:00:14 2012 -0400
Merge topic 'ninja-cldeps' into next
43200c1 Ninja: work with ninja/master, don't compile rc files with cl
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=43200c145d9690701f0cc6dbd5c60ee3ece5edf8
commit 43200c145d9690701f0cc6dbd5c60ee3ece5edf8
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Wed Jun 13 00:52:46 2012 +0200
Commit: Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Wed Jun 13 00:52:46 2012 +0200
Ninja: work with ninja/master, don't compile rc files with cl
Ninja generates for paths with spaces wrong results for $out.d,
using the new DEP_FILE variable instead.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8265d72..90ed270 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -872,6 +872,13 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
return replaceValues.TargetPDB;
}
}
+ if(replaceValues.DependencyFile )
+ {
+ if(variable == "DEP_FILE")
+ {
+ return replaceValues.DependencyFile;
+ }
+ }
if(replaceValues.Target)
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index cb84a30..f53700a 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -235,6 +235,7 @@ public:
const char* LanguageCompileFlags;
const char* Defines;
const char* RuleLauncher;
+ const char* DependencyFile;
};
/** Set whether to treat conversions to SHELL as a link script shell. */
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index df1418f..81715dc 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -55,21 +55,6 @@ cmNinjaNormalTargetGenerator::~cmNinjaNormalTargetGenerator()
{
}
-void
-cmNinjaNormalTargetGenerator
-::EnsureDirectoryExists(const std::string& dir)
-{
- cmSystemTools::MakeDirectory(dir.c_str());
-}
-
-void
-cmNinjaNormalTargetGenerator
-::EnsureParentDirectoryExists(const std::string& path)
-{
- EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str()));
-}
-
-
void cmNinjaNormalTargetGenerator::Generate()
{
if (!this->TargetLinkLanguage) {
diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h
index 3be1c94..1ef9567 100644
--- a/Source/cmNinjaNormalTargetGenerator.h
+++ b/Source/cmNinjaNormalTargetGenerator.h
@@ -35,9 +35,6 @@ private:
void WriteObjectLibStatement();
std::vector<std::string> ComputeLinkCmd();
- void EnsureDirectoryExists(const std::string& dir);
- void EnsureParentDirectoryExists(const std::string& path);
-
private:
// Target name info.
std::string TargetNameOut;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 5c6a45d..ce1aac2 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -333,19 +333,29 @@ cmNinjaTargetGenerator
vars.Defines = "$DEFINES";
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)
+ std::string clDepsBinary;
+ std::string clShowPrefix;
+ if (lang == "C" || lang == "CXX")
{
- useClDeps = true;
- if (projectName && std::string(projectName) == "CMAKE_TRY_COMPILE")
+ const char* depsPtr = mf->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
+ const char* showPtr = mf->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX");
+ if (depsPtr && showPtr)
{
// don't wrap for try_compile,
// TODO but why doesn't it work with cmcldeps?
- useClDeps = false;
+ const std::string projectName = mf->GetProjectName() ?
+ mf->GetProjectName() : "";
+ if (projectName != "CMAKE_TRY_COMPILE")
+ {
+ useClDeps = true;
+ clDepsBinary = depsPtr;
+ clShowPrefix = showPtr;
+ vars.DependencyFile = "$DEP_FILE";
+ }
}
}
@@ -354,15 +364,13 @@ cmNinjaTargetGenerator
std::string depfileFlagsName = "CMAKE_DEPFILE_FLAGS_" + language;
const char *depfileFlags = mf->GetDefinition(depfileFlagsName.c_str());
if (depfileFlags || useClDeps) {
- std::string depfileFlagsStr = depfileFlags ? depfileFlags : "";
- depfile = "$out.d";
- cmSystemTools::ReplaceString(depfileFlagsStr, "<DEPFILE>",
- depfile.c_str());
- cmSystemTools::ReplaceString(depfileFlagsStr, "<OBJECT>",
- "$out");
- cmSystemTools::ReplaceString(depfileFlagsStr, "<CMAKE_C_COMPILER>",
+ std::string depFlagsStr = depfileFlags ? depfileFlags : "";
+ depfile = "$DEP_FILE";
+ cmSystemTools::ReplaceString(depFlagsStr, "<DEPFILE>", "\"$DEP_FILE\"");
+ cmSystemTools::ReplaceString(depFlagsStr, "<OBJECT>", "$out");
+ cmSystemTools::ReplaceString(depFlagsStr, "<CMAKE_C_COMPILER>",
mf->GetDefinition("CMAKE_C_COMPILER"));
- flags += " " + depfileFlagsStr;
+ flags += " " + depFlagsStr;
}
vars.Flags = flags.c_str();
@@ -384,9 +392,8 @@ cmNinjaTargetGenerator
if(useClDeps)
{
- std::string prefix = clShowPrefix;
- cmdLine = "\"" + std::string(clDepsBinary) + "\" $in $out.d $out \""
- + prefix + "\" " + cmdLine;
+ cmdLine = "\"" + clDepsBinary + "\" $in \"$DEP_FILE\" $out \""
+ + clShowPrefix + "\" " + cmdLine;
}
// Write the rule for compiling file of the given language.
@@ -509,6 +516,8 @@ cmNinjaTargetGenerator
cmNinjaVars vars;
vars["FLAGS"] = this->ComputeFlagsForObject(source, language);
vars["DEFINES"] = this->ComputeDefines(source, language);
+ vars["DEP_FILE"] = objectFileName + ".d";;
+ EnsureParentDirectoryExists(objectFileName);
// TODO move to GetTargetPDB
cmMakefile* mf = this->GetMakefile();
@@ -599,3 +608,17 @@ cmNinjaTargetGenerator
this->ModuleDefinitionFile.c_str()));
this->LocalGenerator->AppendFlags(flags, flag.c_str());
}
+
+void
+cmNinjaTargetGenerator
+::EnsureDirectoryExists(const std::string& dir)
+{
+ cmSystemTools::MakeDirectory(dir.c_str());
+}
+
+void
+cmNinjaTargetGenerator
+::EnsureParentDirectoryExists(const std::string& path)
+{
+ EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str()));
+}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index b64ce1e..af43a8b 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -111,6 +111,9 @@ protected:
// Helper to add flag for windows .def file.
void AddModuleDefinitionFlag(std::string& flags);
+ void EnsureDirectoryExists(const std::string& dir);
+ void EnsureParentDirectoryExists(const std::string& path);
+
private:
cmTarget* Target;
cmGeneratorTarget* GeneratorTarget;
-----------------------------------------------------------------------
Summary of changes:
Source/cmLocalGenerator.cxx | 7 ++++
Source/cmLocalGenerator.h | 1 +
Source/cmNinjaNormalTargetGenerator.cxx | 15 --------
Source/cmNinjaNormalTargetGenerator.h | 3 --
Source/cmNinjaTargetGenerator.cxx | 59 +++++++++++++++++++++---------
Source/cmNinjaTargetGenerator.h | 3 ++
6 files changed, 52 insertions(+), 36 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list