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  048f528573587cb310456dc8b28833bc44cbe6d1 (commit)
       via  6271df8ff5ce5552929bb76440fa432641498800 (commit)
      from  0045e4ba1b8b8fe57651f1ce5411f2061d79bdd4 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=048f528573587cb310456dc8b28833bc44cbe6d1
commit 048f528573587cb310456dc8b28833bc44cbe6d1
Merge: 0045e4b 6271df8
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Dec 15 16:28:09 2016 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Thu Dec 15 16:28:09 2016 -0500

    Merge topic 'refactor-compile-pdb-path' into next
    
    6271df8f Makefile,Ninja: De-duplicate MSVC compiler PDB path selection


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6271df8ff5ce5552929bb76440fa432641498800
commit 6271df8ff5ce5552929bb76440fa432641498800
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Dec 15 16:15:28 2016 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Dec 15 16:20:21 2016 -0500

    Makefile,Ninja: De-duplicate MSVC compiler PDB path selection
    
    Add a helper to cmCommonTargetGenerator instead of duplicating it
    in cmMakefileTargetGenerator and cmNinjaTargetGenerator.

diff --git a/Source/cmCommonTargetGenerator.cxx 
b/Source/cmCommonTargetGenerator.cxx
index c3a925f..7e113ab 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -184,6 +184,28 @@ std::vector<std::string> 
cmCommonTargetGenerator::GetLinkedTargetDirectories()
   return dirs;
 }
 
+std::string cmCommonTargetGenerator::ComputeTargetCompilePDB() const
+{
+  std::string compilePdbPath;
+  if (this->GeneratorTarget->GetType() > cmStateEnums::OBJECT_LIBRARY) {
+    return compilePdbPath;
+  }
+  compilePdbPath =
+    this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
+  if (compilePdbPath.empty()) {
+    // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
+    // A trailing slash tells the toolchain to add its default file name.
+    compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/";
+    if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
+      // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`.
+      compilePdbPath += this->GeneratorTarget->GetName();
+      compilePdbPath += ".pdb";
+    }
+  }
+
+  return compilePdbPath;
+}
+
 std::string cmCommonTargetGenerator::GetManifests()
 {
   std::vector<cmSourceFile const*> manifest_srcs;
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index bdd6645..d67fefb 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -66,6 +66,7 @@ protected:
   std::string GetManifests();
 
   std::vector<std::string> GetLinkedTargetDirectories() const;
+  std::string ComputeTargetCompilePDB() const;
 };
 
 #endif
diff --git a/Source/cmMakefileTargetGenerator.cxx 
b/Source/cmMakefileTargetGenerator.cxx
index 4218930..379ae16 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -504,7 +504,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
   {
     std::string targetFullPathReal;
     std::string targetFullPathPDB;
-    std::string targetFullPathCompilePDB;
+    std::string targetFullPathCompilePDB = this->ComputeTargetCompilePDB();
     if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE ||
         this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY ||
         this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
@@ -516,21 +516,6 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
       targetFullPathPDB += "/";
       targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName);
     }
-    if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
-      targetFullPathCompilePDB =
-        this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
-      if (targetFullPathCompilePDB.empty()) {
-        // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
-        // A trailing slash tells the toolchain to add its default file name.
-        targetFullPathCompilePDB =
-          this->GeneratorTarget->GetSupportDirectory() + "/";
-        if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
-          // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`.
-          targetFullPathCompilePDB += this->GeneratorTarget->GetName();
-          targetFullPathCompilePDB += ".pdb";
-        }
-      }
-    }
 
     targetOutPathReal = this->LocalGenerator->ConvertToOutputFormat(
       this->LocalGenerator->MaybeConvertToRelativePath(
diff --git a/Source/cmNinjaTargetGenerator.cxx 
b/Source/cmNinjaTargetGenerator.cxx
index 6fc506d..23caead 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -346,7 +346,7 @@ bool 
cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
   if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
       mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID")) {
     std::string pdbPath;
-    std::string compilePdbPath;
+    std::string compilePdbPath = this->ComputeTargetCompilePDB();
     if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE ||
         this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY ||
         this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
@@ -355,20 +355,6 @@ bool 
cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
       pdbPath += "/";
       pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName());
     }
-    if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
-      compilePdbPath =
-        this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
-      if (compilePdbPath.empty()) {
-        // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
-        // A trailing slash tells the toolchain to add its default file name.
-        compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/";
-        if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
-          // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`.
-          compilePdbPath += this->GeneratorTarget->GetName();
-          compilePdbPath += ".pdb";
-        }
-      }
-    }
 
     vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
       ConvertToNinjaPath(pdbPath), cmOutputConverter::SHELL);

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

Summary of changes:
 Source/cmCommonTargetGenerator.cxx   |   22 ++++++++++++++++++++++
 Source/cmCommonTargetGenerator.h     |    1 +
 Source/cmMakefileTargetGenerator.cxx |   17 +----------------
 Source/cmNinjaTargetGenerator.cxx    |   16 +---------------
 4 files changed, 25 insertions(+), 31 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to