فهرست منبع

BUG: Fixed relink with new install framework.

Brad King 19 سال پیش
والد
کامیت
8dd00d5b1e
4فایلهای تغییر یافته به همراه12 افزوده شده و 2 حذف شده
  1. 1 0
      Source/cmInstallTargetGenerator.cxx
  2. 1 0
      Source/cmInstallTargetsCommand.cxx
  3. 2 1
      Source/cmTarget.cxx
  4. 8 1
      Source/cmTarget.h

+ 1 - 0
Source/cmInstallTargetGenerator.cxx

@@ -26,6 +26,7 @@ cmInstallTargetGenerator
 ::cmInstallTargetGenerator(cmTarget& t, const char* dest, bool implib):
   Target(&t), Destination(dest), ImportLibrary(implib)
 {
+  this->Target->SetHaveInstallRule(true);
 }
 
 //----------------------------------------------------------------------------

+ 1 - 0
Source/cmInstallTargetsCommand.cxx

@@ -46,6 +46,7 @@ bool cmInstallTargetsCommand::InitialPass(std::vector<std::string> const& args)
       {
       tgts[*s].SetInstallPath(args[0].c_str());
       tgts[*s].SetRuntimeInstallPath(runtime_dir.c_str());
+      tgts[*s].SetHaveInstallRule(true);
       }
     else
       {

+ 2 - 1
Source/cmTarget.cxx

@@ -30,6 +30,7 @@ cmTarget::cmTarget()
   m_Makefile = 0;
   m_LinkLibrariesAnalyzed = false;
   m_LinkDirectoriesComputed = false;
+  m_HaveInstallRule = false;
 }
 
 void cmTarget::SetType(TargetType type, const char* name)
@@ -1390,7 +1391,7 @@ bool cmTarget::NeedRelinkBeforeInstall()
 
   // If there is no install location this target will not be installed
   // and therefore does not need relinking.
-  if(this->GetInstallPath().empty())
+  if(!this->GetHaveInstallRule())
     {
     return false;
     }

+ 8 - 1
Source/cmTarget.h

@@ -129,7 +129,13 @@ public:
    */
   std::string GetRuntimeInstallPath() {return m_RuntimeInstallPath;}
   void SetRuntimeInstallPath(const char *name) {m_RuntimeInstallPath = name;}
-  
+
+  /**
+   * Get/Set whether there is an install rule for this target.
+   */
+  bool GetHaveInstallRule() { return m_HaveInstallRule; }
+  void SetHaveInstallRule(bool h) { m_HaveInstallRule = h; }
+
   /**
    * Generate the SourceFilesList from the SourceLists. This should only be
    * done once to be safe.  
@@ -309,6 +315,7 @@ private:
   std::vector<std::string> m_Frameworks;
   std::vector<std::string> m_LinkDirectories;
   std::vector<std::string> m_ExplicitLinkDirectories;
+  bool m_HaveInstallRule;
   std::string m_InstallPath;
   std::string m_RuntimeInstallPath;
   std::string m_Directory;