summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-12-10 14:14:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-12-10 14:14:53 (GMT)
commit9f5e0629df6d7681a520e1de8eff166c278f7c68 (patch)
treeff88ecd437414f0744cb9098e95822ff7e9c48f7 /Source/cmGeneratorTarget.h
parent114c7e72eb33c717ddc4da9e1887ced0603cedb0 (diff)
parent1e49880472e58dedd4819fcd4c49a3346f60bb0d (diff)
downloadCMake-9f5e0629df6d7681a520e1de8eff166c278f7c68.zip
CMake-9f5e0629df6d7681a520e1de8eff166c278f7c68.tar.gz
CMake-9f5e0629df6d7681a520e1de8eff166c278f7c68.tar.bz2
Merge topic 'link-iface-usage-reqs-only'
1e49880472 cmGeneratorTarget: Avoid boolean trap in usage requirement lookup Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6796
Diffstat (limited to 'Source/cmGeneratorTarget.h')
-rw-r--r--Source/cmGeneratorTarget.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 9906963..eff5253 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -237,14 +237,20 @@ public:
cmOptionalLinkInterface& iface,
const cmGeneratorTarget* head) const;
+ enum class LinkInterfaceFor
+ {
+ Usage, // Interface for usage requirements excludes $<LINK_ONLY>.
+ Link, // Interface for linking includes $<LINK_ONLY>.
+ };
+
cmLinkInterfaceLibraries const* GetLinkInterfaceLibraries(
const std::string& config, const cmGeneratorTarget* headTarget,
- bool usage_requirements_only) const;
+ LinkInterfaceFor interfaceFor) const;
void ComputeLinkInterfaceLibraries(const std::string& config,
cmOptionalLinkInterface& iface,
const cmGeneratorTarget* head,
- bool usage_requirements_only) const;
+ LinkInterfaceFor interfaceFor) const;
/** Get the library name for an imported interface library. */
std::string GetImportedLibName(std::string const& config) const;
@@ -781,7 +787,7 @@ public:
std::string EvaluateInterfaceProperty(
std::string const& prop, cmGeneratorExpressionContext* context,
cmGeneratorExpressionDAGChecker* dagCheckerParent,
- bool usage_requirements_only = true) const;
+ LinkInterfaceFor interfaceFor = LinkInterfaceFor::Usage) const;
bool HaveInstallTreeRPATH(const std::string& config) const;
@@ -994,7 +1000,7 @@ private:
cmLinkInterface const* GetImportLinkInterface(const std::string& config,
const cmGeneratorTarget* head,
- bool usage_requirements_only,
+ LinkInterfaceFor interfaceFor,
bool secondPass = false) const;
using KindedSourcesMapType = std::map<std::string, KindedSources>;
@@ -1008,7 +1014,7 @@ private:
mutable std::unordered_map<std::string, bool> MaybeInterfacePropertyExists;
bool MaybeHaveInterfaceProperty(std::string const& prop,
cmGeneratorExpressionContext* context,
- bool usage_requirements_only) const;
+ LinkInterfaceFor interfaceFor) const;
using TargetPropertyEntryVector =
std::vector<std::unique_ptr<TargetPropertyEntry>>;
@@ -1042,7 +1048,7 @@ private:
void ExpandLinkItems(std::string const& prop, std::string const& value,
std::string const& config,
const cmGeneratorTarget* headTarget,
- bool usage_requirements_only,
+ LinkInterfaceFor interfaceFor,
cmLinkInterface& iface) const;
struct LookupLinkItemScope