mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 02:17:27 +08:00
cmLinkItem: Remove redundant cmLinkImplItem class
The cmLinkImplItem class used to contain some additional members to support the CMP0027 policy. Since the CMP0027 policy and those associated members were removed, the cmLinkImplItem class has been a plain wrapper around cmLinkItem with no additional members. It is no longer needed and cmLinkItem can be used directly wherever cmLinkImplItem was used previously.
This commit is contained in:
@@ -221,7 +221,7 @@ void cmComputeTargetDepends::CollectTargetDepends(size_t depender_index)
|
|||||||
|
|
||||||
if (cmLinkImplementation const* impl = depender->GetLinkImplementation(
|
if (cmLinkImplementation const* impl = depender->GetLinkImplementation(
|
||||||
it, cmGeneratorTarget::UseTo::Link)) {
|
it, cmGeneratorTarget::UseTo::Link)) {
|
||||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
for (cmLinkItem const& lib : impl->Libraries) {
|
||||||
// Don't emit the same library twice for this target.
|
// Don't emit the same library twice for this target.
|
||||||
if (emitted.insert(lib).second) {
|
if (emitted.insert(lib).second) {
|
||||||
this->AddTargetDepend(depender_index, lib, true, false);
|
this->AddTargetDepend(depender_index, lib, true, false);
|
||||||
|
@@ -14,8 +14,8 @@
|
|||||||
struct cmGeneratorExpressionDAGChecker;
|
struct cmGeneratorExpressionDAGChecker;
|
||||||
|
|
||||||
EvaluatedTargetPropertyEntry::EvaluatedTargetPropertyEntry(
|
EvaluatedTargetPropertyEntry::EvaluatedTargetPropertyEntry(
|
||||||
cmLinkImplItem const& item, cmListFileBacktrace bt)
|
cmLinkItem const& item, cmListFileBacktrace bt)
|
||||||
: LinkImplItem(item)
|
: LinkItem(item)
|
||||||
, Backtrace(std::move(bt))
|
, Backtrace(std::move(bt))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry(
|
|||||||
cmGeneratorExpressionDAGChecker* dagChecker,
|
cmGeneratorExpressionDAGChecker* dagChecker,
|
||||||
cmGeneratorTarget::TargetPropertyEntry& entry)
|
cmGeneratorTarget::TargetPropertyEntry& entry)
|
||||||
{
|
{
|
||||||
EvaluatedTargetPropertyEntry ee(entry.LinkImplItem, entry.GetBacktrace());
|
EvaluatedTargetPropertyEntry ee(entry.LinkItem, entry.GetBacktrace());
|
||||||
cmExpandList(entry.Evaluate(context, thisTarget, dagChecker), ee.Values);
|
cmExpandList(entry.Evaluate(context, thisTarget, dagChecker), ee.Values);
|
||||||
if (entry.GetHadContextSensitiveCondition()) {
|
if (entry.GetHadContextSensitiveCondition()) {
|
||||||
ee.ContextDependent = true;
|
ee.ContextDependent = true;
|
||||||
@@ -55,9 +55,9 @@ void addInterfaceEntry(cmGeneratorTarget const* headTarget,
|
|||||||
cmGeneratorExpressionDAGChecker* dagChecker,
|
cmGeneratorExpressionDAGChecker* dagChecker,
|
||||||
EvaluatedTargetPropertyEntries& entries,
|
EvaluatedTargetPropertyEntries& entries,
|
||||||
cmGeneratorTarget::UseTo usage,
|
cmGeneratorTarget::UseTo usage,
|
||||||
std::vector<cmLinkImplItem> const& libraries)
|
std::vector<cmLinkItem> const& libraries)
|
||||||
{
|
{
|
||||||
for (cmLinkImplItem const& lib : libraries) {
|
for (cmLinkItem const& lib : libraries) {
|
||||||
if (lib.Target) {
|
if (lib.Target) {
|
||||||
EvaluatedTargetPropertyEntry ee(lib, lib.Backtrace);
|
EvaluatedTargetPropertyEntry ee(lib, lib.Backtrace);
|
||||||
// Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in our
|
// Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in our
|
||||||
|
@@ -15,15 +15,14 @@ struct Context;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class cmLinkImplItem;
|
class cmLinkItem;
|
||||||
struct cmGeneratorExpressionDAGChecker;
|
struct cmGeneratorExpressionDAGChecker;
|
||||||
|
|
||||||
// Represent a target property entry after evaluating generator expressions
|
// Represent a target property entry after evaluating generator expressions
|
||||||
// and splitting up lists.
|
// and splitting up lists.
|
||||||
struct EvaluatedTargetPropertyEntry
|
struct EvaluatedTargetPropertyEntry
|
||||||
{
|
{
|
||||||
EvaluatedTargetPropertyEntry(cmLinkImplItem const& item,
|
EvaluatedTargetPropertyEntry(cmLinkItem const& item, cmListFileBacktrace bt);
|
||||||
cmListFileBacktrace bt);
|
|
||||||
|
|
||||||
// Move-only.
|
// Move-only.
|
||||||
EvaluatedTargetPropertyEntry(EvaluatedTargetPropertyEntry&&) = default;
|
EvaluatedTargetPropertyEntry(EvaluatedTargetPropertyEntry&&) = default;
|
||||||
@@ -33,7 +32,7 @@ struct EvaluatedTargetPropertyEntry
|
|||||||
EvaluatedTargetPropertyEntry& operator=(
|
EvaluatedTargetPropertyEntry& operator=(
|
||||||
EvaluatedTargetPropertyEntry const&) = delete;
|
EvaluatedTargetPropertyEntry const&) = delete;
|
||||||
|
|
||||||
cmLinkImplItem const& LinkImplItem;
|
cmLinkItem const& LinkItem;
|
||||||
cmListFileBacktrace Backtrace;
|
cmListFileBacktrace Backtrace;
|
||||||
std::vector<std::string> Values;
|
std::vector<std::string> Values;
|
||||||
bool ContextDependent = false;
|
bool ContextDependent = false;
|
||||||
|
@@ -2921,7 +2921,7 @@ static std::string getLinkedTargetsContent(
|
|||||||
if (cmLinkImplementationLibraries const* impl =
|
if (cmLinkImplementationLibraries const* impl =
|
||||||
target->GetLinkImplementationLibraries(
|
target->GetLinkImplementationLibraries(
|
||||||
eval->Context.Config, cmGeneratorTarget::UseTo::Compile)) {
|
eval->Context.Config, cmGeneratorTarget::UseTo::Compile)) {
|
||||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
for (cmLinkItem const& lib : impl->Libraries) {
|
||||||
if (lib.Target) {
|
if (lib.Target) {
|
||||||
// Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in our
|
// Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in our
|
||||||
// caller's property and hand-evaluate it as if it were compiled.
|
// caller's property and hand-evaluate it as if it were compiled.
|
||||||
|
@@ -1456,6 +1456,9 @@ private:
|
|||||||
cmValue GetPropertyWithPairedLanguageSupport(std::string const& lang,
|
cmValue GetPropertyWithPairedLanguageSupport(std::string const& lang,
|
||||||
char const* suffix) const;
|
char const* suffix) const;
|
||||||
|
|
||||||
|
std::vector<cmLinkItem> ComputeImplicitLanguageTargets(
|
||||||
|
std::string const& lang, std::string const& config) const;
|
||||||
|
|
||||||
void ComputeLinkImplementationRuntimeLibraries(
|
void ComputeLinkImplementationRuntimeLibraries(
|
||||||
std::string const& config, cmOptionalLinkImplementation& impl) const;
|
std::string const& config, cmOptionalLinkImplementation& impl) const;
|
||||||
|
|
||||||
@@ -1568,10 +1571,10 @@ private:
|
|||||||
class cmGeneratorTarget::TargetPropertyEntry
|
class cmGeneratorTarget::TargetPropertyEntry
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
static cmLinkImplItem NoLinkImplItem;
|
static cmLinkItem NoLinkItem;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TargetPropertyEntry(cmLinkImplItem const& item);
|
TargetPropertyEntry(cmLinkItem const& item);
|
||||||
virtual ~TargetPropertyEntry() = default;
|
virtual ~TargetPropertyEntry() = default;
|
||||||
|
|
||||||
static std::unique_ptr<TargetPropertyEntry> Create(
|
static std::unique_ptr<TargetPropertyEntry> Create(
|
||||||
@@ -1580,7 +1583,7 @@ public:
|
|||||||
static std::unique_ptr<TargetPropertyEntry> CreateFileSet(
|
static std::unique_ptr<TargetPropertyEntry> CreateFileSet(
|
||||||
std::vector<std::string> dirs, bool contextSensitiveDirs,
|
std::vector<std::string> dirs, bool contextSensitiveDirs,
|
||||||
std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
|
std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
|
||||||
cmFileSet const* fileSet, cmLinkImplItem const& item = NoLinkImplItem);
|
cmFileSet const* fileSet, cmLinkItem const& item = NoLinkItem);
|
||||||
|
|
||||||
virtual std::string const& Evaluate(
|
virtual std::string const& Evaluate(
|
||||||
cm::GenEx::Context const& context, cmGeneratorTarget const* headTarget,
|
cm::GenEx::Context const& context, cmGeneratorTarget const* headTarget,
|
||||||
@@ -1590,5 +1593,5 @@ public:
|
|||||||
virtual std::string const& GetInput() const = 0;
|
virtual std::string const& GetInput() const = 0;
|
||||||
virtual bool GetHadContextSensitiveCondition() const;
|
virtual bool GetHadContextSensitiveCondition() const;
|
||||||
|
|
||||||
cmLinkImplItem const& LinkImplItem;
|
cmLinkItem const& LinkItem;
|
||||||
};
|
};
|
||||||
|
@@ -105,7 +105,7 @@ void AddLangSpecificImplicitIncludeDirectories(
|
|||||||
target, propertyName, nullptr, nullptr, context, target->GetBacktrace(),
|
target, propertyName, nullptr, nullptr, context, target->GetBacktrace(),
|
||||||
};
|
};
|
||||||
|
|
||||||
for (cmLinkImplItem const& library : libraries->Libraries) {
|
for (cmLinkItem const& library : libraries->Libraries) {
|
||||||
if (cmGeneratorTarget const* dependency = library.Target) {
|
if (cmGeneratorTarget const* dependency = library.Target) {
|
||||||
if (!dependency->IsInBuildSystem()) {
|
if (!dependency->IsInBuildSystem()) {
|
||||||
continue;
|
continue;
|
||||||
@@ -146,7 +146,7 @@ void processIncludeDirectories(cmGeneratorTarget const* tgt,
|
|||||||
bool debugIncludes)
|
bool debugIncludes)
|
||||||
{
|
{
|
||||||
for (EvaluatedTargetPropertyEntry& entry : entries.Entries) {
|
for (EvaluatedTargetPropertyEntry& entry : entries.Entries) {
|
||||||
cmLinkImplItem const& item = entry.LinkImplItem;
|
cmLinkItem const& item = entry.LinkItem;
|
||||||
std::string const& targetName = item.AsStr();
|
std::string const& targetName = item.AsStr();
|
||||||
bool const fromImported = item.Target && item.Target->IsImported();
|
bool const fromImported = item.Target && item.Target->IsImported();
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
|
|||||||
if (this->IsApple()) {
|
if (this->IsApple()) {
|
||||||
if (cmLinkImplementationLibraries const* impl =
|
if (cmLinkImplementationLibraries const* impl =
|
||||||
this->GetLinkImplementationLibraries(config, UseTo::Compile)) {
|
this->GetLinkImplementationLibraries(config, UseTo::Compile)) {
|
||||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
for (cmLinkItem const& lib : impl->Libraries) {
|
||||||
std::string libDir;
|
std::string libDir;
|
||||||
if (!lib.Target) {
|
if (!lib.Target) {
|
||||||
libDir = cmSystemTools::CollapseFullPath(
|
libDir = cmSystemTools::CollapseFullPath(
|
||||||
|
@@ -208,7 +208,7 @@ bool cmGeneratorTarget::ComputeLinkClosure(std::string const& config,
|
|||||||
// secondPass);
|
// secondPass);
|
||||||
cmTargetCollectLinkLanguages linkLangs(this, config, languages, this,
|
cmTargetCollectLinkLanguages linkLangs(this, config, languages, this,
|
||||||
secondPass);
|
secondPass);
|
||||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
for (cmLinkItem const& lib : impl->Libraries) {
|
||||||
linkLangs.Visit(lib);
|
linkLangs.Visit(lib);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ cmGeneratorTarget::GetLinkImplementationClosure(std::string const& config,
|
|||||||
this->GetLinkImplementationLibraries(config, usage);
|
this->GetLinkImplementationLibraries(config, usage);
|
||||||
assert(impl);
|
assert(impl);
|
||||||
|
|
||||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
for (cmLinkItem const& lib : impl->Libraries) {
|
||||||
processILibs(config, this, lib,
|
processILibs(config, this, lib,
|
||||||
this->LocalGenerator->GetGlobalGenerator(), tgts, emitted,
|
this->LocalGenerator->GetGlobalGenerator(), tgts, emitted,
|
||||||
usage);
|
usage);
|
||||||
@@ -384,7 +384,7 @@ void cmGeneratorTarget::CheckLinkLibraries() const
|
|||||||
|
|
||||||
// Check link the implementation for each generated configuration.
|
// Check link the implementation for each generated configuration.
|
||||||
for (auto const& impl : this->LinkImplMap) {
|
for (auto const& impl : this->LinkImplMap) {
|
||||||
for (cmLinkImplItem const& item : impl.second.Libraries) {
|
for (cmLinkItem const& item : impl.second.Libraries) {
|
||||||
if (!this->VerifyLinkItemColons(LinkItemRole::Implementation, item)) {
|
if (!this->VerifyLinkItemColons(LinkItemRole::Implementation, item)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -686,7 +686,7 @@ void cmGeneratorTarget::ComputeLinkInterface(std::string const& config,
|
|||||||
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
|
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
|
||||||
cmLinkImplementation const* impl =
|
cmLinkImplementation const* impl =
|
||||||
this->GetLinkImplementation(config, UseTo::Link, secondPass);
|
this->GetLinkImplementation(config, UseTo::Link, secondPass);
|
||||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
for (cmLinkItem const& lib : impl->Libraries) {
|
||||||
if (emitted.insert(lib).second) {
|
if (emitted.insert(lib).second) {
|
||||||
if (lib.Target) {
|
if (lib.Target) {
|
||||||
// This is a runtime dependency on another shared library.
|
// This is a runtime dependency on another shared library.
|
||||||
@@ -813,54 +813,31 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
|
|||||||
LinkInterfaceField::HeadExclude, iface);
|
LinkInterfaceField::HeadExclude, iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
std::vector<cmLinkItem> cmGeneratorTarget::ComputeImplicitLanguageTargets(
|
||||||
|
std::string const& lang, std::string const& config) const
|
||||||
template <typename ReturnType>
|
|
||||||
ReturnType constructItem(cmGeneratorTarget* target,
|
|
||||||
cmListFileBacktrace const& bt);
|
|
||||||
|
|
||||||
template <>
|
|
||||||
inline cmLinkImplItem constructItem(cmGeneratorTarget* target,
|
|
||||||
cmListFileBacktrace const& bt)
|
|
||||||
{
|
|
||||||
return cmLinkImplItem(cmLinkItem(target, false, bt));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
inline cmLinkItem constructItem(cmGeneratorTarget* target,
|
|
||||||
cmListFileBacktrace const& bt)
|
|
||||||
{
|
|
||||||
return cmLinkItem(target, false, bt);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename ValueType>
|
|
||||||
std::vector<ValueType> computeImplicitLanguageTargets(
|
|
||||||
std::string const& lang, std::string const& config,
|
|
||||||
cmGeneratorTarget const* currentTarget)
|
|
||||||
{
|
{
|
||||||
cmListFileBacktrace bt;
|
cmListFileBacktrace bt;
|
||||||
std::vector<ValueType> result;
|
std::vector<cmLinkItem> result;
|
||||||
cmLocalGenerator* lg = currentTarget->GetLocalGenerator();
|
cmLocalGenerator* lg = this->GetLocalGenerator();
|
||||||
|
|
||||||
std::string const& runtimeLibrary =
|
std::string const& runtimeLibrary =
|
||||||
currentTarget->GetRuntimeLinkLibrary(lang, config);
|
this->GetRuntimeLinkLibrary(lang, config);
|
||||||
if (cmValue runtimeLinkOptions = currentTarget->Makefile->GetDefinition(
|
if (cmValue runtimeLinkOptions = this->Makefile->GetDefinition(
|
||||||
"CMAKE_" + lang + "_RUNTIME_LIBRARIES_" + runtimeLibrary)) {
|
"CMAKE_" + lang + "_RUNTIME_LIBRARIES_" + runtimeLibrary)) {
|
||||||
cmList libsList{ *runtimeLinkOptions };
|
cmList libsList{ *runtimeLinkOptions };
|
||||||
result.reserve(libsList.size());
|
result.reserve(libsList.size());
|
||||||
|
|
||||||
for (auto const& i : libsList) {
|
for (auto const& i : libsList) {
|
||||||
cmGeneratorTarget::TargetOrString resolved =
|
cmGeneratorTarget::TargetOrString resolved =
|
||||||
currentTarget->ResolveTargetReference(i, lg);
|
this->ResolveTargetReference(i, lg);
|
||||||
if (resolved.Target) {
|
if (resolved.Target) {
|
||||||
result.emplace_back(constructItem<ValueType>(resolved.Target, bt));
|
result.emplace_back(resolved.Target, false, bt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void cmGeneratorTarget::ComputeLinkInterfaceRuntimeLibraries(
|
void cmGeneratorTarget::ComputeLinkInterfaceRuntimeLibraries(
|
||||||
std::string const& config, cmOptionalLinkInterface& iface) const
|
std::string const& config, cmOptionalLinkInterface& iface) const
|
||||||
@@ -869,9 +846,8 @@ void cmGeneratorTarget::ComputeLinkInterfaceRuntimeLibraries(
|
|||||||
if ((lang == "CUDA" || lang == "HIP") &&
|
if ((lang == "CUDA" || lang == "HIP") &&
|
||||||
iface.LanguageRuntimeLibraries.find(lang) ==
|
iface.LanguageRuntimeLibraries.find(lang) ==
|
||||||
iface.LanguageRuntimeLibraries.end()) {
|
iface.LanguageRuntimeLibraries.end()) {
|
||||||
auto implicitTargets =
|
iface.LanguageRuntimeLibraries[lang] =
|
||||||
computeImplicitLanguageTargets<cmLinkItem>(lang, config, this);
|
this->ComputeImplicitLanguageTargets(lang, config);
|
||||||
iface.LanguageRuntimeLibraries[lang] = std::move(implicitTargets);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -883,9 +859,8 @@ void cmGeneratorTarget::ComputeLinkImplementationRuntimeLibraries(
|
|||||||
if ((lang == "CUDA" || lang == "HIP") &&
|
if ((lang == "CUDA" || lang == "HIP") &&
|
||||||
impl.LanguageRuntimeLibraries.find(lang) ==
|
impl.LanguageRuntimeLibraries.find(lang) ==
|
||||||
impl.LanguageRuntimeLibraries.end()) {
|
impl.LanguageRuntimeLibraries.end()) {
|
||||||
auto implicitTargets =
|
impl.LanguageRuntimeLibraries[lang] =
|
||||||
computeImplicitLanguageTargets<cmLinkImplItem>(lang, config, this);
|
this->ComputeImplicitLanguageTargets(lang, config);
|
||||||
impl.LanguageRuntimeLibraries[lang] = std::move(implicitTargets);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1093,7 +1068,7 @@ void TransitiveLinkImpl::Follow(cmGeneratorTarget const* target)
|
|||||||
void TransitiveLinkImpl::Compute()
|
void TransitiveLinkImpl::Compute()
|
||||||
{
|
{
|
||||||
// Save the original items and start with an empty list.
|
// Save the original items and start with an empty list.
|
||||||
std::vector<cmLinkImplItem> original = std::move(this->Impl.Libraries);
|
std::vector<cmLinkItem> original = std::move(this->Impl.Libraries);
|
||||||
|
|
||||||
// Avoid injecting any original items as usage requirements.
|
// Avoid injecting any original items as usage requirements.
|
||||||
// This gives LINK_LIBRARIES final control over the order
|
// This gives LINK_LIBRARIES final control over the order
|
||||||
@@ -1101,7 +1076,7 @@ void TransitiveLinkImpl::Compute()
|
|||||||
this->Emitted.insert(original.cbegin(), original.cend());
|
this->Emitted.insert(original.cbegin(), original.cend());
|
||||||
|
|
||||||
// Process each original item.
|
// Process each original item.
|
||||||
for (cmLinkImplItem& item : original) {
|
for (cmLinkItem& item : original) {
|
||||||
// Inject direct dependencies listed in 'INTERFACE_LINK_LIBRARIES_DIRECT'
|
// Inject direct dependencies listed in 'INTERFACE_LINK_LIBRARIES_DIRECT'
|
||||||
// usage requirements before the item itself.
|
// usage requirements before the item itself.
|
||||||
this->Follow(item.Target);
|
this->Follow(item.Target);
|
||||||
@@ -1114,7 +1089,7 @@ void TransitiveLinkImpl::Compute()
|
|||||||
// usage requirements found through any dependency above.
|
// usage requirements found through any dependency above.
|
||||||
this->Impl.Libraries.erase(
|
this->Impl.Libraries.erase(
|
||||||
std::remove_if(this->Impl.Libraries.begin(), this->Impl.Libraries.end(),
|
std::remove_if(this->Impl.Libraries.begin(), this->Impl.Libraries.end(),
|
||||||
[this](cmLinkImplItem const& item) {
|
[this](cmLinkItem const& item) {
|
||||||
return this->Excluded.find(item) != this->Excluded.end();
|
return this->Excluded.find(item) != this->Excluded.end();
|
||||||
}),
|
}),
|
||||||
this->Impl.Libraries.end());
|
this->Impl.Libraries.end());
|
||||||
|
@@ -36,7 +36,7 @@ void processLinkDirectories(cmGeneratorTarget const* tgt,
|
|||||||
bool debugDirectories)
|
bool debugDirectories)
|
||||||
{
|
{
|
||||||
for (EvaluatedTargetPropertyEntry& entry : entries.Entries) {
|
for (EvaluatedTargetPropertyEntry& entry : entries.Entries) {
|
||||||
cmLinkImplItem const& item = entry.LinkImplItem;
|
cmLinkItem const& item = entry.LinkItem;
|
||||||
std::string const& targetName = item.AsStr();
|
std::string const& targetName = item.AsStr();
|
||||||
|
|
||||||
std::string usedDirectories;
|
std::string usedDirectories;
|
||||||
|
@@ -55,7 +55,7 @@ void AddObjectEntries(cmGeneratorTarget const* headTarget,
|
|||||||
headTarget->GetLinkImplementationLibraries(context.Config,
|
headTarget->GetLinkImplementationLibraries(context.Config,
|
||||||
UseTo::Link)) {
|
UseTo::Link)) {
|
||||||
entries.HadContextSensitiveCondition = impl->HadContextSensitiveCondition;
|
entries.HadContextSensitiveCondition = impl->HadContextSensitiveCondition;
|
||||||
for (cmLinkImplItem const& lib : impl->Libraries) {
|
for (cmLinkItem const& lib : impl->Libraries) {
|
||||||
if (lib.Target &&
|
if (lib.Target &&
|
||||||
lib.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
|
lib.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
|
||||||
std::string uniqueName =
|
std::string uniqueName =
|
||||||
@@ -174,7 +174,7 @@ bool processSources(cmGeneratorTarget const* tgt,
|
|||||||
contextDependent = true;
|
contextDependent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmLinkImplItem const& item = entry.LinkImplItem;
|
cmLinkItem const& item = entry.LinkItem;
|
||||||
std::string const& targetName = item.AsStr();
|
std::string const& targetName = item.AsStr();
|
||||||
|
|
||||||
for (std::string& src : entry.Values) {
|
for (std::string& src : entry.Values) {
|
||||||
|
@@ -26,13 +26,13 @@ struct Context;
|
|||||||
class cmake;
|
class cmake;
|
||||||
struct cmGeneratorExpressionDAGChecker;
|
struct cmGeneratorExpressionDAGChecker;
|
||||||
|
|
||||||
cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
|
cmLinkItem cmGeneratorTarget::TargetPropertyEntry::NoLinkItem;
|
||||||
|
|
||||||
class TargetPropertyEntryString : public cmGeneratorTarget::TargetPropertyEntry
|
class TargetPropertyEntryString : public cmGeneratorTarget::TargetPropertyEntry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TargetPropertyEntryString(BT<std::string> propertyValue,
|
TargetPropertyEntryString(BT<std::string> propertyValue,
|
||||||
cmLinkImplItem const& item = NoLinkImplItem)
|
cmLinkItem const& item = NoLinkItem)
|
||||||
: cmGeneratorTarget::TargetPropertyEntry(item)
|
: cmGeneratorTarget::TargetPropertyEntry(item)
|
||||||
, PropertyValue(std::move(propertyValue))
|
, PropertyValue(std::move(propertyValue))
|
||||||
{
|
{
|
||||||
@@ -62,7 +62,7 @@ class TargetPropertyEntryGenex : public cmGeneratorTarget::TargetPropertyEntry
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TargetPropertyEntryGenex(std::unique_ptr<cmCompiledGeneratorExpression> cge,
|
TargetPropertyEntryGenex(std::unique_ptr<cmCompiledGeneratorExpression> cge,
|
||||||
cmLinkImplItem const& item = NoLinkImplItem)
|
cmLinkItem const& item = NoLinkItem)
|
||||||
: cmGeneratorTarget::TargetPropertyEntry(item)
|
: cmGeneratorTarget::TargetPropertyEntry(item)
|
||||||
, ge(std::move(cge))
|
, ge(std::move(cge))
|
||||||
{
|
{
|
||||||
@@ -98,7 +98,7 @@ public:
|
|||||||
TargetPropertyEntryFileSet(
|
TargetPropertyEntryFileSet(
|
||||||
std::vector<std::string> dirs, bool contextSensitiveDirs,
|
std::vector<std::string> dirs, bool contextSensitiveDirs,
|
||||||
std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
|
std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
|
||||||
cmFileSet const* fileSet, cmLinkImplItem const& item = NoLinkImplItem)
|
cmFileSet const* fileSet, cmLinkItem const& item = NoLinkItem)
|
||||||
: cmGeneratorTarget::TargetPropertyEntry(item)
|
: cmGeneratorTarget::TargetPropertyEntry(item)
|
||||||
, BaseDirs(std::move(dirs))
|
, BaseDirs(std::move(dirs))
|
||||||
, ContextSensitiveDirs(contextSensitiveDirs)
|
, ContextSensitiveDirs(contextSensitiveDirs)
|
||||||
@@ -171,15 +171,15 @@ std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>
|
|||||||
cmGeneratorTarget::TargetPropertyEntry::CreateFileSet(
|
cmGeneratorTarget::TargetPropertyEntry::CreateFileSet(
|
||||||
std::vector<std::string> dirs, bool contextSensitiveDirs,
|
std::vector<std::string> dirs, bool contextSensitiveDirs,
|
||||||
std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
|
std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
|
||||||
cmFileSet const* fileSet, cmLinkImplItem const& item)
|
cmFileSet const* fileSet, cmLinkItem const& item)
|
||||||
{
|
{
|
||||||
return cm::make_unique<TargetPropertyEntryFileSet>(
|
return cm::make_unique<TargetPropertyEntryFileSet>(
|
||||||
std::move(dirs), contextSensitiveDirs, std::move(entryCge), fileSet, item);
|
std::move(dirs), contextSensitiveDirs, std::move(entryCge), fileSet, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmGeneratorTarget::TargetPropertyEntry::TargetPropertyEntry(
|
cmGeneratorTarget::TargetPropertyEntry::TargetPropertyEntry(
|
||||||
cmLinkImplItem const& item)
|
cmLinkItem const& item)
|
||||||
: LinkImplItem(item)
|
: LinkItem(item)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -71,11 +71,6 @@ std::ostream& operator<<(std::ostream& os, cmLinkItem const& item)
|
|||||||
return os << item.AsStr();
|
return os << item.AsStr();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmLinkImplItem::cmLinkImplItem(cmLinkItem item)
|
|
||||||
: cmLinkItem(std::move(item))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
cm::string_view const LL_BEGIN = "<LINK_LIBRARY:"_s;
|
cm::string_view const LL_BEGIN = "<LINK_LIBRARY:"_s;
|
||||||
cm::string_view const LL_END = "</LINK_LIBRARY:"_s;
|
cm::string_view const LL_END = "</LINK_LIBRARY:"_s;
|
||||||
|
@@ -47,19 +47,12 @@ public:
|
|||||||
friend std::ostream& operator<<(std::ostream& os, cmLinkItem const& item);
|
friend std::ostream& operator<<(std::ostream& os, cmLinkItem const& item);
|
||||||
};
|
};
|
||||||
|
|
||||||
class cmLinkImplItem : public cmLinkItem
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
cmLinkImplItem() = default;
|
|
||||||
cmLinkImplItem(cmLinkItem item);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** The link implementation specifies the direct library
|
/** The link implementation specifies the direct library
|
||||||
dependencies needed by the object files of the target. */
|
dependencies needed by the object files of the target. */
|
||||||
struct cmLinkImplementationLibraries
|
struct cmLinkImplementationLibraries
|
||||||
{
|
{
|
||||||
// Libraries linked directly in this configuration.
|
// Libraries linked directly in this configuration.
|
||||||
std::vector<cmLinkImplItem> Libraries;
|
std::vector<cmLinkItem> Libraries;
|
||||||
|
|
||||||
// Object files linked directly in this configuration.
|
// Object files linked directly in this configuration.
|
||||||
std::vector<cmLinkItem> Objects;
|
std::vector<cmLinkItem> Objects;
|
||||||
@@ -124,7 +117,7 @@ struct cmLinkImplementation : public cmLinkImplementationLibraries
|
|||||||
{
|
{
|
||||||
// Languages whose runtime libraries must be linked.
|
// Languages whose runtime libraries must be linked.
|
||||||
std::vector<std::string> Languages;
|
std::vector<std::string> Languages;
|
||||||
std::unordered_map<std::string, std::vector<cmLinkImplItem>>
|
std::unordered_map<std::string, std::vector<cmLinkItem>>
|
||||||
LanguageRuntimeLibraries;
|
LanguageRuntimeLibraries;
|
||||||
|
|
||||||
// Whether the list depends on a link language genex.
|
// Whether the list depends on a link language genex.
|
||||||
|
@@ -159,7 +159,7 @@ void cmLinkLineDeviceComputer::ComputeLinkLibraries(
|
|||||||
cli.GetTarget()->GetLinkImplementation(cli.GetConfig(),
|
cli.GetTarget()->GetLinkImplementation(cli.GetConfig(),
|
||||||
cmGeneratorTarget::UseTo::Link);
|
cmGeneratorTarget::UseTo::Link);
|
||||||
|
|
||||||
for (cmLinkImplItem const& iter : linkImpl->Libraries) {
|
for (cmLinkItem const& iter : linkImpl->Libraries) {
|
||||||
if (iter.Target &&
|
if (iter.Target &&
|
||||||
iter.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
|
iter.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
|
||||||
std::string libPath = iter.Target->GetLocation(cli.GetConfig());
|
std::string libPath = iter.Target->GetLocation(cli.GetConfig());
|
||||||
|
Reference in New Issue
Block a user