Browse Source

cmGeneratorTarget: Move HaveWellDefinedOutputFiles from cmTarget.

Stephen Kelly 10 years ago
parent
commit
3ebc62850c

+ 11 - 1
Source/cmGeneratorTarget.cxx

@@ -1708,6 +1708,16 @@ cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
   return this->Target->GetBacktrace();
 }
 
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const
+{
+  return
+    this->GetType() == cmState::STATIC_LIBRARY ||
+    this->GetType() == cmState::SHARED_LIBRARY ||
+    this->GetType() == cmState::MODULE_LIBRARY ||
+    this->GetType() == cmState::EXECUTABLE;
+}
+
 //----------------------------------------------------------------------------
 const char* cmGeneratorTarget::GetExportMacro() const
 {
@@ -4819,7 +4829,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
     }
 
   // Only libraries and executables have well-defined output files.
-  if(!this->Target->HaveWellDefinedOutputFiles())
+  if(!this->HaveWellDefinedOutputFiles())
     {
     std::string msg = "cmGeneratorTarget::GetOutputInfo called for ";
     msg += this->GetName();

+ 3 - 0
Source/cmGeneratorTarget.h

@@ -196,6 +196,9 @@ public:
 
   std::string GetModuleDefinitionFile(const std::string& config) const;
 
+  /** @return whether this target have a well defined output file name. */
+  bool HaveWellDefinedOutputFiles() const;
+
   /** Link information from the transitive closure of the link
       implementation and the interfaces of its dependencies.  */
   struct LinkClosure

+ 1 - 1
Source/cmOSXBundleGenerator.cxx

@@ -34,7 +34,7 @@ cmOSXBundleGenerator(cmGeneratorTarget* target,
 //----------------------------------------------------------------------------
 bool cmOSXBundleGenerator::MustSkip()
 {
-  return !this->GT->Target->HaveWellDefinedOutputFiles();
+  return !this->GT->HaveWellDefinedOutputFiles();
 }
 
 //----------------------------------------------------------------------------

+ 0 - 10
Source/cmTarget.cxx

@@ -1559,16 +1559,6 @@ void cmTarget::MarkAsImported()
   this->IsImportedTarget = true;
 }
 
-//----------------------------------------------------------------------------
-bool cmTarget::HaveWellDefinedOutputFiles() const
-{
-  return
-    this->GetType() == cmState::STATIC_LIBRARY ||
-    this->GetType() == cmState::SHARED_LIBRARY ||
-    this->GetType() == cmState::MODULE_LIBRARY ||
-    this->GetType() == cmState::EXECUTABLE;
-}
-
 //----------------------------------------------------------------------------
 bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
 {

+ 0 - 3
Source/cmTarget.h

@@ -241,9 +241,6 @@ public:
   /** Get a backtrace from the creation of the target.  */
   cmListFileBacktrace const& GetBacktrace() const;
 
-  /** @return whether this target have a well defined output file name. */
-  bool HaveWellDefinedOutputFiles() const;
-
   void InsertInclude(std::string const& entry,
                      cmListFileBacktrace const& bt,
                      bool before = false);