Răsfoiți Sursa

cmGlobalGenerator: Move GeneratorTargetsType to usage site.

Stephen Kelly 10 ani în urmă
părinte
comite
c2c239e607

+ 0 - 12
Source/cmGeneratorTarget.cxx

@@ -3607,18 +3607,6 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
   return prefix+base+".pdb";
 }
 
-bool cmStrictTargetComparison::operator()(cmTarget const* t1,
-                                          cmTarget const* t2) const
-{
-  int nameResult = strcmp(t1->GetName().c_str(), t2->GetName().c_str());
-  if (nameResult == 0)
-    {
-    return strcmp(t1->GetMakefile()->GetCurrentBinaryDirectory(),
-                  t2->GetMakefile()->GetCurrentBinaryDirectory()) < 0;
-    }
-  return nameResult < 0;
-}
-
 //----------------------------------------------------------------------------
 struct cmGeneratorTarget::SourceFileFlags
 cmGeneratorTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const

+ 0 - 8
Source/cmGeneratorTarget.h

@@ -675,12 +675,4 @@ public:
   }
 };
 
-struct cmStrictTargetComparison {
-  bool operator()(cmTarget const* t1, cmTarget const* t2) const;
-};
-
-typedef std::map<cmTarget const*,
-                 cmGeneratorTarget*,
-                 cmStrictTargetComparison> cmGeneratorTargetsType;
-
 #endif

+ 12 - 0
Source/cmGlobalGenerator.cxx

@@ -48,6 +48,18 @@
 
 #include <assert.h>
 
+bool cmTarget::StrictTargetComparison::operator()(cmTarget const* t1,
+                                                  cmTarget const* t2) const
+{
+  int nameResult = strcmp(t1->GetName().c_str(), t2->GetName().c_str());
+  if (nameResult == 0)
+    {
+    return strcmp(t1->GetMakefile()->GetCurrentBinaryDirectory(),
+                  t2->GetMakefile()->GetCurrentBinaryDirectory()) < 0;
+    }
+  return nameResult < 0;
+}
+
 cmGlobalGenerator::cmGlobalGenerator(cmake* cm)
   : CMakeInstance(cm)
 {

+ 4 - 0
Source/cmGlobalGenerator.h

@@ -42,6 +42,10 @@ class cmInstallTargetGenerator;
 class cmInstallFilesGenerator;
 class cmExportBuildFileGenerator;
 
+typedef std::map<cmTarget const*,
+                 cmGeneratorTarget*,
+                 cmTarget::StrictTargetComparison> cmGeneratorTargetsType;
+
 /** \class cmGlobalGenerator
  * \brief Responsible for overseeing the generation process for the entire tree
  *

+ 4 - 0
Source/cmTarget.h

@@ -260,6 +260,10 @@ public:
   return this->LinkLibrariesForVS6;}
 #endif
 
+  struct StrictTargetComparison {
+    bool operator()(cmTarget const* t1, cmTarget const* t2) const;
+  };
+
 private:
   bool HandleLocationPropertyPolicy(cmMakefile* context) const;