|
@@ -112,16 +112,22 @@ public:
|
|
|
struct OptionalLinkInterface: public cmTarget::LinkInterface
|
|
struct OptionalLinkInterface: public cmTarget::LinkInterface
|
|
|
{
|
|
{
|
|
|
OptionalLinkInterface():
|
|
OptionalLinkInterface():
|
|
|
- Exists(false), Complete(false), ExplicitLibraries(0) {}
|
|
|
|
|
|
|
+ LibrariesDone(false), AllDone(false),
|
|
|
|
|
+ Exists(false), ExplicitLibraries(0) {}
|
|
|
|
|
+ bool LibrariesDone;
|
|
|
|
|
+ bool AllDone;
|
|
|
bool Exists;
|
|
bool Exists;
|
|
|
- bool Complete;
|
|
|
|
|
const char* ExplicitLibraries;
|
|
const char* ExplicitLibraries;
|
|
|
};
|
|
};
|
|
|
void ComputeLinkInterface(cmTarget const* thisTarget,
|
|
void ComputeLinkInterface(cmTarget const* thisTarget,
|
|
|
const std::string& config,
|
|
const std::string& config,
|
|
|
OptionalLinkInterface& iface,
|
|
OptionalLinkInterface& iface,
|
|
|
- cmTarget const* head,
|
|
|
|
|
- const char *explicitLibraries) const;
|
|
|
|
|
|
|
+ cmTarget const* head) const;
|
|
|
|
|
+ void ComputeLinkInterfaceLibraries(cmTarget const* thisTarget,
|
|
|
|
|
+ const std::string& config,
|
|
|
|
|
+ OptionalLinkInterface& iface,
|
|
|
|
|
+ cmTarget const* head,
|
|
|
|
|
+ bool usage_requirements_only);
|
|
|
|
|
|
|
|
typedef std::map<TargetConfigPair, OptionalLinkInterface>
|
|
typedef std::map<TargetConfigPair, OptionalLinkInterface>
|
|
|
LinkInterfaceMapType;
|
|
LinkInterfaceMapType;
|
|
@@ -129,7 +135,7 @@ public:
|
|
|
LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap;
|
|
LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap;
|
|
|
bool PolicyWarnedCMP0022;
|
|
bool PolicyWarnedCMP0022;
|
|
|
|
|
|
|
|
- typedef std::map<TargetConfigPair, cmTarget::LinkInterface>
|
|
|
|
|
|
|
+ typedef std::map<TargetConfigPair, OptionalLinkInterface>
|
|
|
ImportLinkInterfaceMapType;
|
|
ImportLinkInterfaceMapType;
|
|
|
ImportLinkInterfaceMapType ImportLinkInterfaceMap;
|
|
ImportLinkInterfaceMapType ImportLinkInterfaceMap;
|
|
|
ImportLinkInterfaceMapType ImportLinkInterfaceUsageRequirementsOnlyMap;
|
|
ImportLinkInterfaceMapType ImportLinkInterfaceUsageRequirementsOnlyMap;
|
|
@@ -158,8 +164,8 @@ public:
|
|
|
typedef std::map<std::string, cmTarget::LinkClosure> LinkClosureMapType;
|
|
typedef std::map<std::string, cmTarget::LinkClosure> LinkClosureMapType;
|
|
|
LinkClosureMapType LinkClosureMap;
|
|
LinkClosureMapType LinkClosureMap;
|
|
|
|
|
|
|
|
- typedef std::map<TargetConfigPair, std::vector<cmSourceFile*> >
|
|
|
|
|
- SourceFilesMapType;
|
|
|
|
|
|
|
+ typedef std::map<std::string, std::vector<cmSourceFile*> >
|
|
|
|
|
+ SourceFilesMapType;
|
|
|
SourceFilesMapType SourceFilesMap;
|
|
SourceFilesMapType SourceFilesMap;
|
|
|
|
|
|
|
|
std::set<cmLinkItem> UtilityItems;
|
|
std::set<cmLinkItem> UtilityItems;
|
|
@@ -631,7 +637,6 @@ static bool processSources(cmTarget const* tgt,
|
|
|
std::vector<std::string> &srcs,
|
|
std::vector<std::string> &srcs,
|
|
|
std::set<std::string> &uniqueSrcs,
|
|
std::set<std::string> &uniqueSrcs,
|
|
|
cmGeneratorExpressionDAGChecker *dagChecker,
|
|
cmGeneratorExpressionDAGChecker *dagChecker,
|
|
|
- cmTarget const* head,
|
|
|
|
|
std::string const& config, bool debugSources)
|
|
std::string const& config, bool debugSources)
|
|
|
{
|
|
{
|
|
|
cmMakefile *mf = tgt->GetMakefile();
|
|
cmMakefile *mf = tgt->GetMakefile();
|
|
@@ -648,7 +653,7 @@ static bool processSources(cmTarget const* tgt,
|
|
|
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
|
|
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
|
|
|
config,
|
|
config,
|
|
|
false,
|
|
false,
|
|
|
- head ? head : tgt,
|
|
|
|
|
|
|
+ tgt,
|
|
|
tgt,
|
|
tgt,
|
|
|
dagChecker),
|
|
dagChecker),
|
|
|
entrySources);
|
|
entrySources);
|
|
@@ -714,8 +719,7 @@ static bool processSources(cmTarget const* tgt,
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
void cmTarget::GetSourceFiles(std::vector<std::string> &files,
|
|
void cmTarget::GetSourceFiles(std::vector<std::string> &files,
|
|
|
- const std::string& config,
|
|
|
|
|
- cmTarget const* head) const
|
|
|
|
|
|
|
+ const std::string& config) const
|
|
|
{
|
|
{
|
|
|
assert(this->GetType() != INTERFACE_LIBRARY);
|
|
assert(this->GetType() != INTERFACE_LIBRARY);
|
|
|
|
|
|
|
@@ -779,7 +783,6 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
|
|
|
files,
|
|
files,
|
|
|
uniqueSrcs,
|
|
uniqueSrcs,
|
|
|
&dagChecker,
|
|
&dagChecker,
|
|
|
- head,
|
|
|
|
|
config,
|
|
config,
|
|
|
debugSources);
|
|
debugSources);
|
|
|
|
|
|
|
@@ -796,7 +799,6 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
|
|
|
files,
|
|
files,
|
|
|
uniqueSrcs,
|
|
uniqueSrcs,
|
|
|
&dagChecker,
|
|
&dagChecker,
|
|
|
- head,
|
|
|
|
|
config,
|
|
config,
|
|
|
debugSources);
|
|
debugSources);
|
|
|
|
|
|
|
@@ -875,12 +877,11 @@ cmTarget::GetConfigCommonSourceFiles(std::vector<cmSourceFile*>& files) const
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
|
|
void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
|
|
|
- const std::string& config,
|
|
|
|
|
- cmTarget const* head) const
|
|
|
|
|
|
|
+ const std::string& config) const
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
// Lookup any existing link implementation for this configuration.
|
|
// Lookup any existing link implementation for this configuration.
|
|
|
- TargetConfigPair key(head, cmSystemTools::UpperCase(config));
|
|
|
|
|
|
|
+ std::string key = cmSystemTools::UpperCase(config);
|
|
|
|
|
|
|
|
if(!this->LinkImplementationLanguageIsContextDependent)
|
|
if(!this->LinkImplementationLanguageIsContextDependent)
|
|
|
{
|
|
{
|
|
@@ -897,7 +898,7 @@ void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
std::vector<std::string> srcs;
|
|
std::vector<std::string> srcs;
|
|
|
- this->GetSourceFiles(srcs, config, head);
|
|
|
|
|
|
|
+ this->GetSourceFiles(srcs, config);
|
|
|
|
|
|
|
|
std::set<cmSourceFile*> emitted;
|
|
std::set<cmSourceFile*> emitted;
|
|
|
|
|
|
|
@@ -5430,11 +5431,10 @@ cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
void cmTarget::GetLanguages(std::set<std::string>& languages,
|
|
void cmTarget::GetLanguages(std::set<std::string>& languages,
|
|
|
- const std::string& config,
|
|
|
|
|
- cmTarget const* head) const
|
|
|
|
|
|
|
+ const std::string& config) const
|
|
|
{
|
|
{
|
|
|
std::vector<cmSourceFile*> sourceFiles;
|
|
std::vector<cmSourceFile*> sourceFiles;
|
|
|
- this->GetSourceFiles(sourceFiles, config, head);
|
|
|
|
|
|
|
+ this->GetSourceFiles(sourceFiles, config);
|
|
|
for(std::vector<cmSourceFile*>::const_iterator
|
|
for(std::vector<cmSourceFile*>::const_iterator
|
|
|
i = sourceFiles.begin(); i != sourceFiles.end(); ++i)
|
|
i = sourceFiles.begin(); i != sourceFiles.end(); ++i)
|
|
|
{
|
|
{
|
|
@@ -5470,7 +5470,7 @@ void cmTarget::GetLanguages(std::set<std::string>& languages,
|
|
|
for(std::vector<cmTarget*>::const_iterator
|
|
for(std::vector<cmTarget*>::const_iterator
|
|
|
i = objectLibraries.begin(); i != objectLibraries.end(); ++i)
|
|
i = objectLibraries.begin(); i != objectLibraries.end(); ++i)
|
|
|
{
|
|
{
|
|
|
- (*i)->GetLanguages(languages, config, head);
|
|
|
|
|
|
|
+ (*i)->GetLanguages(languages, config);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -5912,32 +5912,24 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
|
|
|
// Lookup any existing link interface for this configuration.
|
|
// Lookup any existing link interface for this configuration.
|
|
|
TargetConfigPair key(head, cmSystemTools::UpperCase(config));
|
|
TargetConfigPair key(head, cmSystemTools::UpperCase(config));
|
|
|
|
|
|
|
|
- cmTargetInternals::LinkInterfaceMapType::iterator
|
|
|
|
|
- i = this->Internal->LinkInterfaceMap.find(key);
|
|
|
|
|
- if(i == this->Internal->LinkInterfaceMap.end())
|
|
|
|
|
|
|
+ cmTargetInternals::OptionalLinkInterface&
|
|
|
|
|
+ iface = this->Internal->LinkInterfaceMap[key];
|
|
|
|
|
+ if(!iface.LibrariesDone)
|
|
|
{
|
|
{
|
|
|
- // Compute the link interface for this configuration.
|
|
|
|
|
- cmTargetInternals::OptionalLinkInterface iface;
|
|
|
|
|
- iface.ExplicitLibraries =
|
|
|
|
|
- this->ComputeLinkInterfaceLibraries(config, iface, head, false,
|
|
|
|
|
- iface.Exists);
|
|
|
|
|
- if (iface.Exists)
|
|
|
|
|
- {
|
|
|
|
|
- this->Internal->ComputeLinkInterface(this, config, iface,
|
|
|
|
|
- head, iface.ExplicitLibraries);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Store the information for this configuration.
|
|
|
|
|
- cmTargetInternals::LinkInterfaceMapType::value_type entry(key, iface);
|
|
|
|
|
- i = this->Internal->LinkInterfaceMap.insert(entry).first;
|
|
|
|
|
|
|
+ iface.LibrariesDone = true;
|
|
|
|
|
+ this->Internal->ComputeLinkInterfaceLibraries(
|
|
|
|
|
+ this, config, iface, head, false);
|
|
|
}
|
|
}
|
|
|
- else if(!i->second.Complete && i->second.Exists)
|
|
|
|
|
|
|
+ if(!iface.AllDone)
|
|
|
{
|
|
{
|
|
|
- this->Internal->ComputeLinkInterface(this, config, i->second, head,
|
|
|
|
|
- i->second.ExplicitLibraries);
|
|
|
|
|
|
|
+ iface.AllDone = true;
|
|
|
|
|
+ if(iface.Exists)
|
|
|
|
|
+ {
|
|
|
|
|
+ this->Internal->ComputeLinkInterface(this, config, iface, head);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return i->second.Exists ? &i->second : 0;
|
|
|
|
|
|
|
+ return iface.Exists? &iface : 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
@@ -5967,22 +5959,15 @@ cmTarget::GetLinkInterfaceLibraries(const std::string& config,
|
|
|
this->Internal->LinkInterfaceUsageRequirementsOnlyMap :
|
|
this->Internal->LinkInterfaceUsageRequirementsOnlyMap :
|
|
|
this->Internal->LinkInterfaceMap);
|
|
this->Internal->LinkInterfaceMap);
|
|
|
|
|
|
|
|
- cmTargetInternals::LinkInterfaceMapType::iterator i = lim.find(key);
|
|
|
|
|
- if(i == lim.end())
|
|
|
|
|
|
|
+ cmTargetInternals::OptionalLinkInterface& iface = lim[key];
|
|
|
|
|
+ if(!iface.LibrariesDone)
|
|
|
{
|
|
{
|
|
|
- // Compute the link interface for this configuration.
|
|
|
|
|
- cmTargetInternals::OptionalLinkInterface iface;
|
|
|
|
|
- iface.ExplicitLibraries =
|
|
|
|
|
- this->ComputeLinkInterfaceLibraries(config, iface, head,
|
|
|
|
|
- usage_requirements_only,
|
|
|
|
|
- iface.Exists);
|
|
|
|
|
-
|
|
|
|
|
- // Store the information for this configuration.
|
|
|
|
|
- cmTargetInternals::LinkInterfaceMapType::value_type entry(key, iface);
|
|
|
|
|
- i = lim.insert(entry).first;
|
|
|
|
|
|
|
+ iface.LibrariesDone = true;
|
|
|
|
|
+ this->Internal->ComputeLinkInterfaceLibraries(
|
|
|
|
|
+ this, config, iface, head, usage_requirements_only);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return i->second.Exists ? &i->second : 0;
|
|
|
|
|
|
|
+ return iface.Exists? &iface : 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
@@ -6003,26 +5988,21 @@ cmTarget::GetImportLinkInterface(const std::string& config,
|
|
|
this->Internal->ImportLinkInterfaceUsageRequirementsOnlyMap :
|
|
this->Internal->ImportLinkInterfaceUsageRequirementsOnlyMap :
|
|
|
this->Internal->ImportLinkInterfaceMap);
|
|
this->Internal->ImportLinkInterfaceMap);
|
|
|
|
|
|
|
|
- cmTargetInternals::ImportLinkInterfaceMapType::iterator i = lim.find(key);
|
|
|
|
|
- if(i == lim.end())
|
|
|
|
|
|
|
+ cmTargetInternals::OptionalLinkInterface& iface = lim[key];
|
|
|
|
|
+ if(!iface.AllDone)
|
|
|
{
|
|
{
|
|
|
- LinkInterface iface;
|
|
|
|
|
|
|
+ iface.AllDone = true;
|
|
|
iface.Multiplicity = info->Multiplicity;
|
|
iface.Multiplicity = info->Multiplicity;
|
|
|
cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
|
|
cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
|
|
|
this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config,
|
|
this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config,
|
|
|
headTarget, usage_requirements_only,
|
|
headTarget, usage_requirements_only,
|
|
|
iface.Libraries);
|
|
iface.Libraries);
|
|
|
- {
|
|
|
|
|
std::vector<std::string> deps;
|
|
std::vector<std::string> deps;
|
|
|
cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
|
|
cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
|
|
|
this->LookupLinkItems(deps, iface.SharedDeps);
|
|
this->LookupLinkItems(deps, iface.SharedDeps);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- cmTargetInternals::ImportLinkInterfaceMapType::value_type
|
|
|
|
|
- entry(key, iface);
|
|
|
|
|
- i = lim.insert(entry).first;
|
|
|
|
|
- }
|
|
|
|
|
- return &i->second;
|
|
|
|
|
|
|
+ return &iface;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
@@ -6102,11 +6082,13 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
-const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
|
|
|
|
|
- LinkInterface& iface,
|
|
|
|
|
- cmTarget const* headTarget,
|
|
|
|
|
- bool usage_requirements_only,
|
|
|
|
|
- bool &exists) const
|
|
|
|
|
|
|
+void
|
|
|
|
|
+cmTargetInternals::ComputeLinkInterfaceLibraries(
|
|
|
|
|
+ cmTarget const* thisTarget,
|
|
|
|
|
+ const std::string& config,
|
|
|
|
|
+ OptionalLinkInterface& iface,
|
|
|
|
|
+ cmTarget const* headTarget,
|
|
|
|
|
+ bool usage_requirements_only)
|
|
|
{
|
|
{
|
|
|
// Construct the property name suffix for this configuration.
|
|
// Construct the property name suffix for this configuration.
|
|
|
std::string suffix = "_";
|
|
std::string suffix = "_";
|
|
@@ -6123,15 +6105,15 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
|
|
|
// libraries and executables that export symbols.
|
|
// libraries and executables that export symbols.
|
|
|
const char* explicitLibraries = 0;
|
|
const char* explicitLibraries = 0;
|
|
|
std::string linkIfaceProp;
|
|
std::string linkIfaceProp;
|
|
|
- if(this->PolicyStatusCMP0022 != cmPolicies::OLD &&
|
|
|
|
|
- this->PolicyStatusCMP0022 != cmPolicies::WARN)
|
|
|
|
|
|
|
+ if(thisTarget->PolicyStatusCMP0022 != cmPolicies::OLD &&
|
|
|
|
|
+ thisTarget->PolicyStatusCMP0022 != cmPolicies::WARN)
|
|
|
{
|
|
{
|
|
|
// CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES.
|
|
// CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES.
|
|
|
linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
|
|
linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
|
|
|
- explicitLibraries = this->GetProperty(linkIfaceProp);
|
|
|
|
|
|
|
+ explicitLibraries = thisTarget->GetProperty(linkIfaceProp);
|
|
|
}
|
|
}
|
|
|
- else if(this->GetType() == cmTarget::SHARED_LIBRARY ||
|
|
|
|
|
- this->IsExecutableWithExports())
|
|
|
|
|
|
|
+ else if(thisTarget->GetType() == cmTarget::SHARED_LIBRARY ||
|
|
|
|
|
+ thisTarget->IsExecutableWithExports())
|
|
|
{
|
|
{
|
|
|
// CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a
|
|
// CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a
|
|
|
// shared lib or executable.
|
|
// shared lib or executable.
|
|
@@ -6139,31 +6121,32 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
|
|
|
// Lookup the per-configuration property.
|
|
// Lookup the per-configuration property.
|
|
|
linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
|
|
linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
|
|
|
linkIfaceProp += suffix;
|
|
linkIfaceProp += suffix;
|
|
|
- explicitLibraries = this->GetProperty(linkIfaceProp);
|
|
|
|
|
|
|
+ explicitLibraries = thisTarget->GetProperty(linkIfaceProp);
|
|
|
|
|
|
|
|
// If not set, try the generic property.
|
|
// If not set, try the generic property.
|
|
|
if(!explicitLibraries)
|
|
if(!explicitLibraries)
|
|
|
{
|
|
{
|
|
|
linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
|
|
linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
|
|
|
- explicitLibraries = this->GetProperty(linkIfaceProp);
|
|
|
|
|
|
|
+ explicitLibraries = thisTarget->GetProperty(linkIfaceProp);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(explicitLibraries && this->PolicyStatusCMP0022 == cmPolicies::WARN &&
|
|
|
|
|
- !this->Internal->PolicyWarnedCMP0022)
|
|
|
|
|
|
|
+ if(explicitLibraries &&
|
|
|
|
|
+ thisTarget->PolicyStatusCMP0022 == cmPolicies::WARN &&
|
|
|
|
|
+ !this->PolicyWarnedCMP0022)
|
|
|
{
|
|
{
|
|
|
// Compare the explicitly set old link interface properties to the
|
|
// Compare the explicitly set old link interface properties to the
|
|
|
// preferred new link interface property one and warn if different.
|
|
// preferred new link interface property one and warn if different.
|
|
|
const char* newExplicitLibraries =
|
|
const char* newExplicitLibraries =
|
|
|
- this->GetProperty("INTERFACE_LINK_LIBRARIES");
|
|
|
|
|
|
|
+ thisTarget->GetProperty("INTERFACE_LINK_LIBRARIES");
|
|
|
if (newExplicitLibraries
|
|
if (newExplicitLibraries
|
|
|
&& strcmp(newExplicitLibraries, explicitLibraries) != 0)
|
|
&& strcmp(newExplicitLibraries, explicitLibraries) != 0)
|
|
|
{
|
|
{
|
|
|
cmOStringStream w;
|
|
cmOStringStream w;
|
|
|
w <<
|
|
w <<
|
|
|
- (this->Makefile->GetPolicies()
|
|
|
|
|
|
|
+ (thisTarget->Makefile->GetPolicies()
|
|
|
->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
|
|
->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
|
|
|
- "Target \"" << this->GetName() << "\" has an "
|
|
|
|
|
|
|
+ "Target \"" << thisTarget->GetName() << "\" has an "
|
|
|
"INTERFACE_LINK_LIBRARIES property which differs from its " <<
|
|
"INTERFACE_LINK_LIBRARIES property which differs from its " <<
|
|
|
linkIfaceProp << " properties."
|
|
linkIfaceProp << " properties."
|
|
|
"\n"
|
|
"\n"
|
|
@@ -6171,53 +6154,53 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
|
|
|
" " << newExplicitLibraries << "\n" <<
|
|
" " << newExplicitLibraries << "\n" <<
|
|
|
linkIfaceProp << ":\n"
|
|
linkIfaceProp << ":\n"
|
|
|
" " << (explicitLibraries ? explicitLibraries : "(empty)") << "\n";
|
|
" " << (explicitLibraries ? explicitLibraries : "(empty)") << "\n";
|
|
|
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
|
|
|
|
|
- this->Internal->PolicyWarnedCMP0022 = true;
|
|
|
|
|
|
|
+ thisTarget->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
|
|
|
|
|
+ this->PolicyWarnedCMP0022 = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// There is no implicit link interface for executables or modules
|
|
// There is no implicit link interface for executables or modules
|
|
|
// so if none was explicitly set then there is no link interface.
|
|
// so if none was explicitly set then there is no link interface.
|
|
|
if(!explicitLibraries &&
|
|
if(!explicitLibraries &&
|
|
|
- (this->GetType() == cmTarget::EXECUTABLE ||
|
|
|
|
|
- (this->GetType() == cmTarget::MODULE_LIBRARY)))
|
|
|
|
|
|
|
+ (thisTarget->GetType() == cmTarget::EXECUTABLE ||
|
|
|
|
|
+ (thisTarget->GetType() == cmTarget::MODULE_LIBRARY)))
|
|
|
{
|
|
{
|
|
|
- exists = false;
|
|
|
|
|
- return 0;
|
|
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
- exists = true;
|
|
|
|
|
|
|
+ iface.Exists = true;
|
|
|
|
|
+ iface.ExplicitLibraries = explicitLibraries;
|
|
|
|
|
|
|
|
if(explicitLibraries)
|
|
if(explicitLibraries)
|
|
|
{
|
|
{
|
|
|
// The interface libraries have been explicitly set.
|
|
// The interface libraries have been explicitly set.
|
|
|
- this->ExpandLinkItems(linkIfaceProp, explicitLibraries, config,
|
|
|
|
|
- headTarget, usage_requirements_only,
|
|
|
|
|
- iface.Libraries);
|
|
|
|
|
|
|
+ thisTarget->ExpandLinkItems(linkIfaceProp, explicitLibraries, config,
|
|
|
|
|
+ headTarget, usage_requirements_only,
|
|
|
|
|
+ iface.Libraries);
|
|
|
}
|
|
}
|
|
|
- else if (this->PolicyStatusCMP0022 == cmPolicies::WARN
|
|
|
|
|
- || this->PolicyStatusCMP0022 == cmPolicies::OLD)
|
|
|
|
|
|
|
+ else if (thisTarget->PolicyStatusCMP0022 == cmPolicies::WARN
|
|
|
|
|
+ || thisTarget->PolicyStatusCMP0022 == cmPolicies::OLD)
|
|
|
// If CMP0022 is NEW then the plain tll signature sets the
|
|
// If CMP0022 is NEW then the plain tll signature sets the
|
|
|
// INTERFACE_LINK_LIBRARIES, so if we get here then the project
|
|
// INTERFACE_LINK_LIBRARIES, so if we get here then the project
|
|
|
// cleared the property explicitly and we should not fall back
|
|
// cleared the property explicitly and we should not fall back
|
|
|
// to the link implementation.
|
|
// to the link implementation.
|
|
|
{
|
|
{
|
|
|
// The link implementation is the default link interface.
|
|
// The link implementation is the default link interface.
|
|
|
- LinkImplementation const* impl =
|
|
|
|
|
- this->GetLinkImplementationLibrariesInternal(config, headTarget);
|
|
|
|
|
|
|
+ cmTarget::LinkImplementation const* impl =
|
|
|
|
|
+ thisTarget->GetLinkImplementationLibrariesInternal(config, headTarget);
|
|
|
std::copy(impl->Libraries.begin(), impl->Libraries.end(),
|
|
std::copy(impl->Libraries.begin(), impl->Libraries.end(),
|
|
|
std::back_inserter(iface.Libraries));
|
|
std::back_inserter(iface.Libraries));
|
|
|
- if(this->PolicyStatusCMP0022 == cmPolicies::WARN &&
|
|
|
|
|
- !this->Internal->PolicyWarnedCMP0022 && !usage_requirements_only)
|
|
|
|
|
|
|
+ if(thisTarget->PolicyStatusCMP0022 == cmPolicies::WARN &&
|
|
|
|
|
+ !this->PolicyWarnedCMP0022 && !usage_requirements_only)
|
|
|
{
|
|
{
|
|
|
// Compare the link implementation fallback link interface to the
|
|
// Compare the link implementation fallback link interface to the
|
|
|
// preferred new link interface property and warn if different.
|
|
// preferred new link interface property and warn if different.
|
|
|
std::vector<cmLinkItem> ifaceLibs;
|
|
std::vector<cmLinkItem> ifaceLibs;
|
|
|
std::string newProp = "INTERFACE_LINK_LIBRARIES";
|
|
std::string newProp = "INTERFACE_LINK_LIBRARIES";
|
|
|
- if(const char* newExplicitLibraries = this->GetProperty(newProp))
|
|
|
|
|
|
|
+ if(const char* newExplicitLibraries = thisTarget->GetProperty(newProp))
|
|
|
{
|
|
{
|
|
|
- this->ExpandLinkItems(newProp, newExplicitLibraries, config,
|
|
|
|
|
- headTarget, usage_requirements_only,
|
|
|
|
|
- ifaceLibs);
|
|
|
|
|
|
|
+ thisTarget->ExpandLinkItems(newProp, newExplicitLibraries, config,
|
|
|
|
|
+ headTarget, usage_requirements_only,
|
|
|
|
|
+ ifaceLibs);
|
|
|
}
|
|
}
|
|
|
if (ifaceLibs != iface.Libraries)
|
|
if (ifaceLibs != iface.Libraries)
|
|
|
{
|
|
{
|
|
@@ -6246,9 +6229,9 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
|
|
|
|
|
|
|
|
cmOStringStream w;
|
|
cmOStringStream w;
|
|
|
w <<
|
|
w <<
|
|
|
- (this->Makefile->GetPolicies()
|
|
|
|
|
|
|
+ (thisTarget->Makefile->GetPolicies()
|
|
|
->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
|
|
->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
|
|
|
- "Target \"" << this->GetName() << "\" has an "
|
|
|
|
|
|
|
+ "Target \"" << thisTarget->GetName() << "\" has an "
|
|
|
"INTERFACE_LINK_LIBRARIES property. "
|
|
"INTERFACE_LINK_LIBRARIES property. "
|
|
|
"This should be preferred as the source of the link interface "
|
|
"This should be preferred as the source of the link interface "
|
|
|
"for this library but because CMP0022 is not set CMake is "
|
|
"for this library but because CMP0022 is not set CMake is "
|
|
@@ -6259,22 +6242,20 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
|
|
|
" " << newLibraries << "\n"
|
|
" " << newLibraries << "\n"
|
|
|
"Link implementation:\n"
|
|
"Link implementation:\n"
|
|
|
" " << oldLibraries << "\n";
|
|
" " << oldLibraries << "\n";
|
|
|
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
|
|
|
|
|
- this->Internal->PolicyWarnedCMP0022 = true;
|
|
|
|
|
|
|
+ thisTarget->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
|
|
|
|
|
+ this->PolicyWarnedCMP0022 = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return explicitLibraries;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
|
|
void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
|
|
|
const std::string& config,
|
|
const std::string& config,
|
|
|
OptionalLinkInterface& iface,
|
|
OptionalLinkInterface& iface,
|
|
|
- cmTarget const* headTarget,
|
|
|
|
|
- const char* explicitLibraries) const
|
|
|
|
|
|
|
+ cmTarget const* headTarget) const
|
|
|
{
|
|
{
|
|
|
- if(explicitLibraries)
|
|
|
|
|
|
|
+ if(iface.ExplicitLibraries)
|
|
|
{
|
|
{
|
|
|
if(thisTarget->GetType() == cmTarget::SHARED_LIBRARY
|
|
if(thisTarget->GetType() == cmTarget::SHARED_LIBRARY
|
|
|
|| thisTarget->GetType() == cmTarget::STATIC_LIBRARY
|
|
|| thisTarget->GetType() == cmTarget::STATIC_LIBRARY
|
|
@@ -6365,7 +6346,6 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
|
|
|
sscanf(reps, "%u", &iface.Multiplicity);
|
|
sscanf(reps, "%u", &iface.Multiplicity);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- iface.Complete = true;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
@@ -6416,7 +6396,7 @@ cmTarget::GetLinkImplementation(const std::string& config) const
|
|
|
if(!impl.LanguagesDone)
|
|
if(!impl.LanguagesDone)
|
|
|
{
|
|
{
|
|
|
impl.LanguagesDone = true;
|
|
impl.LanguagesDone = true;
|
|
|
- this->ComputeLinkImplementationLanguages(config, impl, this);
|
|
|
|
|
|
|
+ this->ComputeLinkImplementationLanguages(config, impl);
|
|
|
}
|
|
}
|
|
|
return &impl;
|
|
return &impl;
|
|
|
}
|
|
}
|
|
@@ -6557,13 +6537,12 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
void
|
|
void
|
|
|
cmTarget::ComputeLinkImplementationLanguages(const std::string& config,
|
|
cmTarget::ComputeLinkImplementationLanguages(const std::string& config,
|
|
|
- LinkImplementation& impl,
|
|
|
|
|
- cmTarget const* head) const
|
|
|
|
|
|
|
+ LinkImplementation& impl) const
|
|
|
{
|
|
{
|
|
|
// This target needs runtime libraries for its source languages.
|
|
// This target needs runtime libraries for its source languages.
|
|
|
std::set<std::string> languages;
|
|
std::set<std::string> languages;
|
|
|
// Get languages used in our source files.
|
|
// Get languages used in our source files.
|
|
|
- this->GetLanguages(languages, config, head);
|
|
|
|
|
|
|
+ this->GetLanguages(languages, config);
|
|
|
// Copy the set of langauges to the link implementation.
|
|
// Copy the set of langauges to the link implementation.
|
|
|
for(std::set<std::string>::iterator li = languages.begin();
|
|
for(std::set<std::string>::iterator li = languages.begin();
|
|
|
li != languages.end(); ++li)
|
|
li != languages.end(); ++li)
|