Ver código fonte

ENH: Added cmTarget::GetPDBName method to simplify computation of .pdb file name for a target.

Brad King 19 anos atrás
pai
commit
4bc0fd0941
3 arquivos alterados com 16 adições e 14 exclusões
  1. 2 14
      Source/cmLocalVisualStudio7Generator.cxx
  2. 11 0
      Source/cmTarget.cxx
  3. 3 0
      Source/cmTarget.h

+ 2 - 14
Source/cmLocalVisualStudio7Generator.cxx

@@ -638,29 +638,17 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
     {
     if(target.GetType() == cmTarget::EXECUTABLE)
       {
-      std::string targetName;
-      std::string targetNameFull;
-      std::string targetNamePDB;
-      target.GetExecutableNames(targetName, targetNameFull,
-                                targetNamePDB, configName);
       fout <<  "\t\t\t\tProgramDataBaseFileName=\""
            << this->ExecutableOutputPath
-           << "$(OutDir)/" << targetNamePDB << "\"\n";
+           << "$(OutDir)/" << target.GetPDBName(configName) << "\"\n";
       }
     else if(target.GetType() == cmTarget::STATIC_LIBRARY ||
             target.GetType() == cmTarget::SHARED_LIBRARY ||
             target.GetType() == cmTarget::MODULE_LIBRARY)
       {
-      std::string targetName;
-      std::string targetNameSO;
-      std::string targetNameFull;
-      std::string targetNameImport;
-      std::string targetNamePDB;
-      target.GetLibraryNames(targetName, targetNameSO, targetNameFull,
-                             targetNameImport, targetNamePDB, configName);
       fout <<  "\t\t\t\tProgramDataBaseFileName=\""
            << this->LibraryOutputPath
-           << "$(OutDir)/" << targetNamePDB << "\"\n";
+           << "$(OutDir)/" << target.GetPDBName(configName) << "\"\n";
       }
     }
   fout << "/>\n";  // end of <Tool Name=VCCLCompilerTool

+ 11 - 0
Source/cmTarget.cxx

@@ -1375,6 +1375,17 @@ const char* cmTarget::GetPrefixVariableInternal(TargetType type,
   return "";
 }
 
+//----------------------------------------------------------------------------
+std::string cmTarget::GetPDBName(const char* config)
+{
+  std::string prefix;
+  std::string base;
+  std::string suffix;
+  this->GetFullNameInternal(this->GetType(), config, false,
+                            prefix, base, suffix);
+  return prefix+base+".pdb";
+}
+
 //----------------------------------------------------------------------------
 std::string cmTarget::GetFullName(const char* config, bool implib)
 {

+ 3 - 0
Source/cmTarget.h

@@ -205,6 +205,9 @@ public:
   void GetFullName(std::string& prefix, 
                    std::string& base, std::string& suffix,
                    const char* config=0, bool implib = false);
+
+  /** Get the name of the pdb file for the target.  */
+  std::string GetPDBName(const char* config=0);
   
   /** Get the full path to the target according to the settings in its
       makefile and the configuration type.  */