[Cmake-commits] CMake branch, next, updated. v2.8.9-225-g8291e8f

Peter Kuemmel syntheticpp at gmx.net
Wed Aug 22 08:21:12 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  8291e8f900d44863ce99f1e4ba002201ab888693 (commit)
       via  709fa59562569b6c6a8244f5ba53b60ebf840a30 (commit)
       via  4bb4787780e51d18b9744f52bfa635818dd34ca5 (commit)
       via  59cbc28b92bf0cd91f760985edcde625a6fbcf6c (commit)
       via  c478d55e31e65205e4948bf8b487363891a638a4 (commit)
      from  678c2c3c372795a8fa08986d0653db6b57712ec0 (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=8291e8f900d44863ce99f1e4ba002201ab888693
commit 8291e8f900d44863ce99f1e4ba002201ab888693
Merge: 678c2c3 709fa59
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Wed Aug 22 08:21:03 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Aug 22 08:21:03 2012 -0400

    Merge topic 'ninja-target-pdb-cleanup' into next
    
    709fa59 Ninja: remove GetTargetPDB because it is used only once
    4bb4787 Ninja:split out setting of msvc TARGET_PDB
    59cbc28 Ninja: prepare msvc pdb cleanup
    c478d55 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=709fa59562569b6c6a8244f5ba53b60ebf840a30
commit 709fa59562569b6c6a8244f5ba53b60ebf840a30
Author:     Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Wed Aug 22 12:42:16 2012 +0200
Commit:     Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Wed Aug 22 14:11:30 2012 +0200

    Ninja: remove GetTargetPDB because it is used only once

diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index b89602e..0256aa9 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -295,21 +295,6 @@ std::string cmNinjaTargetGenerator::GetTargetName() const
   return this->Target->GetName();
 }
 
-std::string cmNinjaTargetGenerator::GetTargetPDB() const
-{
-  std::string targetFullPathPDB;
-  if(this->Target->GetType() == cmTarget::EXECUTABLE ||
-     this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
-     this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
-     this->Target->GetType() == cmTarget::MODULE_LIBRARY)
-    {
-    targetFullPathPDB = this->Target->GetDirectory(this->GetConfigName());
-    targetFullPathPDB += "/";
-    targetFullPathPDB += this->Target->GetPDBName(this->GetConfigName());
-    }
-
-  return targetFullPathPDB.c_str();
-}
 
 bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
 {
@@ -317,7 +302,17 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
   if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
       mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
     {
-    const std::string pdbPath = this->GetTargetPDB();
+    std::string pdbPath;
+    if(this->Target->GetType() == cmTarget::EXECUTABLE ||
+       this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
+       this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
+       this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+      {
+      pdbPath = this->Target->GetDirectory(this->GetConfigName());
+      pdbPath += "/";
+      pdbPath += this->Target->GetPDBName(this->GetConfigName());
+    }
+
     vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
                           ConvertToNinjaPath(pdbPath.c_str()).c_str(),
                           cmLocalGenerator::SHELL);
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 0c52fc4..cd20694 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -40,7 +40,6 @@ public:
 
   virtual void Generate() = 0;
 
-  std::string GetTargetPDB() const;
   std::string GetTargetName() const;
 
 protected:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bb4787780e51d18b9744f52bfa635818dd34ca5
commit 4bb4787780e51d18b9744f52bfa635818dd34ca5
Author:     Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Wed Aug 22 12:37:55 2012 +0200
Commit:     Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Wed Aug 22 12:37:55 2012 +0200

    Ninja:split out setting of msvc TARGET_PDB

diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 59db295..9dc860e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -468,16 +468,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   }
 
   cmMakefile* mf = this->GetMakefile();
-  if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
-      mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
-    {
-    const std::string pdbPath = this->GetTargetPDB();
-    vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-                          ConvertToNinjaPath(pdbPath.c_str()).c_str(),
-                          cmLocalGenerator::SHELL);
-    EnsureParentDirectoryExists(pdbPath);
-    }
-  else
+  if (!this->SetMsvcTargetPdbVariable(vars))
     {
     // It is common to place debug symbols at a specific place,
     // so we need a plain target name in the rule available.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 328ca2d..b89602e 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -311,6 +311,21 @@ std::string cmNinjaTargetGenerator::GetTargetPDB() const
   return targetFullPathPDB.c_str();
 }
 
+bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
+{
+  cmMakefile* mf = this->GetMakefile();
+  if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
+      mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
+    {
+    const std::string pdbPath = this->GetTargetPDB();
+    vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
+                          ConvertToNinjaPath(pdbPath.c_str()).c_str(),
+                          cmLocalGenerator::SHELL);
+    EnsureParentDirectoryExists(pdbPath);
+    return true;
+    }
+  return false;
+}
 
 void
 cmNinjaTargetGenerator
@@ -537,17 +552,7 @@ cmNinjaTargetGenerator
   vars["DEP_FILE"] = objectFileName + ".d";;
   EnsureParentDirectoryExists(objectFileName);
 
-  // TODO move to GetTargetPDB
-  cmMakefile* mf = this->GetMakefile();
-  if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
-      mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
-    {
-    const std::string pdbPath = this->GetTargetPDB();
-    vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-                          ConvertToNinjaPath(pdbPath.c_str()).c_str(),
-                          cmLocalGenerator::SHELL);
-    EnsureParentDirectoryExists(pdbPath);
-    }
+  this->SetMsvcTargetPdbVariable(vars);
 
   if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS"))
     {
@@ -643,14 +648,14 @@ cmNinjaTargetGenerator
 
 void
 cmNinjaTargetGenerator
-::EnsureDirectoryExists(const std::string& dir)
+::EnsureDirectoryExists(const std::string& dir) const
 {
   cmSystemTools::MakeDirectory(dir.c_str());
 }
 
 void
 cmNinjaTargetGenerator
-::EnsureParentDirectoryExists(const std::string& path)
+::EnsureParentDirectoryExists(const std::string& path) const
 {
   EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str()));
 }
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 84573ce..0c52fc4 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -44,6 +44,9 @@ public:
   std::string GetTargetName() const;
 
 protected:
+
+  bool SetMsvcTargetPdbVariable(cmNinjaVars&) const;
+
   cmGeneratedFileStream& GetBuildFileStream() const;
   cmGeneratedFileStream& GetRulesFileStream() const;
 
@@ -112,8 +115,8 @@ 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);
+  void EnsureDirectoryExists(const std::string& dir) const;
+  void EnsureParentDirectoryExists(const std::string& path) const;
 
   // write rules for Mac OS X Application Bundle content.
   struct MacOSXContentGeneratorType :

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59cbc28b92bf0cd91f760985edcde625a6fbcf6c
commit 59cbc28b92bf0cd91f760985edcde625a6fbcf6c
Author:     Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Wed Aug 22 12:26:56 2012 +0200
Commit:     Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Wed Aug 22 12:26:56 2012 +0200

    Ninja: prepare msvc pdb cleanup

diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index a923d60..59db295 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -459,23 +459,23 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     }
   }
 
-  std::string path;
   if (!this->TargetNameImport.empty()) {
-    path = this->GetLocalGenerator()->ConvertToOutputFormat(
-                    targetOutputImplib.c_str(), cmLocalGenerator::SHELL);
-    vars["TARGET_IMPLIB"] = path;
-    EnsureParentDirectoryExists(path);
+    const std::string impLibPath = this->GetLocalGenerator()
+      ->ConvertToOutputFormat(targetOutputImplib.c_str(),
+                              cmLocalGenerator::SHELL);
+    vars["TARGET_IMPLIB"] = impLibPath;
+    EnsureParentDirectoryExists(impLibPath);
   }
 
   cmMakefile* mf = this->GetMakefile();
   if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
       mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
     {
-    path = this->GetTargetPDB();
+    const std::string pdbPath = this->GetTargetPDB();
     vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-                          ConvertToNinjaPath(path.c_str()).c_str(),
+                          ConvertToNinjaPath(pdbPath.c_str()).c_str(),
                           cmLocalGenerator::SHELL);
-    EnsureParentDirectoryExists(path);
+    EnsureParentDirectoryExists(pdbPath);
     }
   else
     {
@@ -494,9 +494,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
 
   if (mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
     {
-    path = GetTarget()->GetSupportDirectory();
-    vars["OBJECT_DIR"] = ConvertToNinjaPath(path.c_str());
-    EnsureDirectoryExists(path);
+    const std::string objPath = GetTarget()->GetSupportDirectory();
+    vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath.c_str());
+    EnsureDirectoryExists(objPath);
     // ar.exe can't handle backslashes in rsp files (implictly used by gcc)
     std::string& linkLibraries = vars["LINK_LIBRARIES"];
     std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
@@ -527,10 +527,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   // If we have any PRE_LINK commands, we need to go back to HOME_OUTPUT for
   // the link commands.
   if (!preLinkCmdLines.empty()) {
-    path = this->GetLocalGenerator()->ConvertToOutputFormat(
-      this->GetMakefile()->GetHomeOutputDirectory(),
-      cmLocalGenerator::SHELL);
-    preLinkCmdLines.push_back("cd " + path);
+    const std::string homeOutDir = this->GetLocalGenerator()
+      ->ConvertToOutputFormat(this->GetMakefile()->GetHomeOutputDirectory(),
+                              cmLocalGenerator::SHELL);
+    preLinkCmdLines.push_back("cd " + homeOutDir);
   }
 
   vars["PRE_LINK"] =
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index b6bdfdc..328ca2d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -542,9 +542,11 @@ cmNinjaTargetGenerator
   if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
       mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
     {
+    const std::string pdbPath = this->GetTargetPDB();
     vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-                        ConvertToNinjaPath(GetTargetPDB().c_str()).c_str(),
-                        cmLocalGenerator::SHELL);
+                          ConvertToNinjaPath(pdbPath.c_str()).c_str(),
+                          cmLocalGenerator::SHELL);
+    EnsureParentDirectoryExists(pdbPath);
     }
 
   if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS"))

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeVersion.cmake               |    2 +-
 Source/cmNinjaNormalTargetGenerator.cxx |   35 +++++++++---------------
 Source/cmNinjaTargetGenerator.cxx       |   46 ++++++++++++++++---------------
 Source/cmNinjaTargetGenerator.h         |    8 +++--
 4 files changed, 43 insertions(+), 48 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list