Kaynağa Gözat

COMP: Pimplize cmTarget ImportInfo and OutputInfo

These member structures are accessed only in the cmTarget implementation
so they do not need to be defined in the header.  This cleanup also aids
Visual Studio 6 in compiling them.
Brad King 16 yıl önce
ebeveyn
işleme
aef8fe509b
2 değiştirilmiş dosya ile 35 ekleme ve 25 silme
  1. 33 8
      Source/cmTarget.cxx
  2. 2 17
      Source/cmTarget.h

+ 33 - 8
Source/cmTarget.cxx

@@ -35,6 +35,23 @@ const char* cmTarget::TargetTypeNames[] = {
   "UNKNOWN_LIBRARY"
   "UNKNOWN_LIBRARY"
 };
 };
 
 
+//----------------------------------------------------------------------------
+struct cmTarget::OutputInfo
+{
+  std::string OutDir;
+  std::string ImpDir;
+};
+
+//----------------------------------------------------------------------------
+struct cmTarget::ImportInfo
+{
+  bool NoSOName;
+  std::string Location;
+  std::string SOName;
+  std::string ImportLibrary;
+  cmTarget::LinkInterface LinkInterface;
+};
+
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 class cmTargetInternals
 class cmTargetInternals
 {
 {
@@ -58,6 +75,12 @@ public:
   };
   };
   typedef std::map<cmStdString, OptionalLinkInterface> LinkInterfaceMapType;
   typedef std::map<cmStdString, OptionalLinkInterface> LinkInterfaceMapType;
   LinkInterfaceMapType LinkInterfaceMap;
   LinkInterfaceMapType LinkInterfaceMap;
+
+  typedef std::map<cmStdString, cmTarget::OutputInfo> OutputInfoMapType;
+  OutputInfoMapType OutputInfoMap;
+
+  typedef std::map<cmStdString, cmTarget::ImportInfo> ImportInfoMapType;
+  ImportInfoMapType ImportInfoMap;
 };
 };
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
@@ -1855,7 +1878,7 @@ void cmTarget::SetProperty(const char* prop, const char* value)
   // information.
   // information.
   if(this->IsImported() && strncmp(prop, "IMPORTED", 8) == 0)
   if(this->IsImported() && strncmp(prop, "IMPORTED", 8) == 0)
     {
     {
-    this->ImportInfoMap.clear();
+    this->Internal->ImportInfoMap.clear();
     }
     }
 }
 }
 
 
@@ -1872,7 +1895,7 @@ void cmTarget::AppendProperty(const char* prop, const char* value)
   // information.
   // information.
   if(this->IsImported() && strncmp(prop, "IMPORTED", 8) == 0)
   if(this->IsImported() && strncmp(prop, "IMPORTED", 8) == 0)
     {
     {
-    this->ImportInfoMap.clear();
+    this->Internal->ImportInfoMap.clear();
     }
     }
 }
 }
 
 
@@ -1974,15 +1997,16 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config)
     {
     {
     config_upper = cmSystemTools::UpperCase(config);
     config_upper = cmSystemTools::UpperCase(config);
     }
     }
+  typedef cmTargetInternals::OutputInfoMapType OutputInfoMapType;
   OutputInfoMapType::const_iterator i =
   OutputInfoMapType::const_iterator i =
-    this->OutputInfoMap.find(config_upper);
-  if(i == this->OutputInfoMap.end())
+    this->Internal->OutputInfoMap.find(config_upper);
+  if(i == this->Internal->OutputInfoMap.end())
     {
     {
     OutputInfo info;
     OutputInfo info;
     this->ComputeOutputDir(config, false, info.OutDir);
     this->ComputeOutputDir(config, false, info.OutDir);
     this->ComputeOutputDir(config, true, info.ImpDir);
     this->ComputeOutputDir(config, true, info.ImpDir);
     OutputInfoMapType::value_type entry(config_upper, info);
     OutputInfoMapType::value_type entry(config_upper, info);
-    i = this->OutputInfoMap.insert(entry).first;
+    i = this->Internal->OutputInfoMap.insert(entry).first;
     }
     }
   return &i->second;
   return &i->second;
 }
 }
@@ -3416,14 +3440,15 @@ cmTarget::GetImportInfo(const char* config)
     {
     {
     config_upper = "NOCONFIG";
     config_upper = "NOCONFIG";
     }
     }
+  typedef cmTargetInternals::ImportInfoMapType ImportInfoMapType;
   ImportInfoMapType::const_iterator i =
   ImportInfoMapType::const_iterator i =
-    this->ImportInfoMap.find(config_upper);
-  if(i == this->ImportInfoMap.end())
+    this->Internal->ImportInfoMap.find(config_upper);
+  if(i == this->Internal->ImportInfoMap.end())
     {
     {
     ImportInfo info;
     ImportInfo info;
     this->ComputeImportInfo(config_upper, info);
     this->ComputeImportInfo(config_upper, info);
     ImportInfoMapType::value_type entry(config_upper, info);
     ImportInfoMapType::value_type entry(config_upper, info);
-    i = this->ImportInfoMap.insert(entry).first;
+    i = this->Internal->ImportInfoMap.insert(entry).first;
     }
     }
 
 
   // If the location is empty then the target is not available for
   // If the location is empty then the target is not available for

+ 2 - 17
Source/cmTarget.h

@@ -507,27 +507,12 @@ private:
   bool IsImportedTarget;
   bool IsImportedTarget;
 
 
   // Cache target output paths for each configuration.
   // Cache target output paths for each configuration.
-  struct OutputInfo
-  {
-    std::string OutDir;
-    std::string ImpDir;
-  };
-  typedef std::map<cmStdString, OutputInfo> OutputInfoMapType;
-  OutputInfoMapType OutputInfoMap;
+  struct OutputInfo;
   OutputInfo const* GetOutputInfo(const char* config);
   OutputInfo const* GetOutputInfo(const char* config);
   void ComputeOutputDir(const char* config, bool implib, std::string& out);
   void ComputeOutputDir(const char* config, bool implib, std::string& out);
 
 
   // Cache import information from properties for each configuration.
   // Cache import information from properties for each configuration.
-  struct ImportInfo
-  {
-    bool NoSOName;
-    std::string Location;
-    std::string SOName;
-    std::string ImportLibrary;
-    cmTarget::LinkInterface LinkInterface;
-  };
-  typedef std::map<cmStdString, ImportInfo> ImportInfoMapType;
-  ImportInfoMapType ImportInfoMap;
+  struct ImportInfo;
   ImportInfo const* GetImportInfo(const char* config);
   ImportInfo const* GetImportInfo(const char* config);
   void ComputeImportInfo(std::string const& desired_config, ImportInfo& info);
   void ComputeImportInfo(std::string const& desired_config, ImportInfo& info);