فهرست منبع

Centralize maintenance of usage requirement include directories

Maintain a target's internal list of usage requirement include
directories whenever the LINK_LIBRARIES property is set by either
target_link_libraries or set_property.
Stephen Kelly 12 سال پیش
والد
کامیت
b8259c3d69
3فایلهای تغییر یافته به همراه17 افزوده شده و 15 حذف شده
  1. 17 6
      Source/cmTarget.cxx
  2. 0 1
      Source/cmTarget.h
  3. 0 8
      Source/cmTargetLinkLibrariesCommand.cxx

+ 17 - 6
Source/cmTarget.cxx

@@ -2706,6 +2706,15 @@ void cmTarget::SetProperty(const char* prop, const char* value)
                           new cmTargetInternals::IncludeDirectoriesEntry(cge));
     return;
     }
+  if (strcmp(prop, "LINK_LIBRARIES") == 0)
+    {
+    this->Internal->LinkInterfaceIncludeDirectoriesEntries.clear();
+    cmListFileBacktrace lfbt;
+    this->Makefile->GetBacktrace(lfbt);
+    cmValueWithOrigin entry(value, lfbt);
+    this->Internal->LinkInterfaceIncludeDirectoriesEntries.push_back(entry);
+    // Fall through
+    }
   this->Properties.SetProperty(prop, value, cmProperty::TARGET);
   this->MaybeInvalidatePropertyCache(prop);
 }
@@ -2727,6 +2736,14 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
               new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(value)));
     return;
     }
+  if (strcmp(prop, "LINK_LIBRARIES") == 0)
+    {
+    cmListFileBacktrace lfbt;
+    this->Makefile->GetBacktrace(lfbt);
+    cmValueWithOrigin entry(value, lfbt);
+    this->Internal->LinkInterfaceIncludeDirectoriesEntries.push_back(entry);
+    // Fall through
+    }
   this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
   this->MaybeInvalidatePropertyCache(prop);
 }
@@ -2762,12 +2779,6 @@ void cmTarget::AppendBuildInterfaceIncludes()
     }
 }
 
-//----------------------------------------------------------------------------
-void cmTarget::AppendTllInclude(const cmValueWithOrigin &entry)
-{
-  this->Internal->LinkInterfaceIncludeDirectoriesEntries.push_back(entry);
-}
-
 //----------------------------------------------------------------------------
 void cmTarget::InsertInclude(const cmValueWithOrigin &entry,
                      bool before)

+ 0 - 1
Source/cmTarget.h

@@ -495,7 +495,6 @@ public:
   std::vector<std::string> GetIncludeDirectories(const char *config);
   void InsertInclude(const cmValueWithOrigin &entry,
                      bool before = false);
-  void AppendTllInclude(const cmValueWithOrigin &entry);
 
   void AppendBuildInterfaceIncludes();
 

+ 0 - 8
Source/cmTargetLinkLibrariesCommand.cxx

@@ -259,14 +259,6 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
   // Handle normal case first.
   if(this->CurrentProcessingState != ProcessingLinkInterface)
     {
-    {
-    cmListFileBacktrace lfbt;
-    this->Makefile->GetBacktrace(lfbt);
-    cmValueWithOrigin entry(this->Target->GetDebugGeneratorExpressions(lib,
-                                                                       llt),
-                            lfbt);
-    this->Target->AppendTllInclude(entry);
-    }
     this->Makefile
       ->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt);
     if (this->CurrentProcessingState != ProcessingPublicInterface)