summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-04-05 15:21:57 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-04-19 13:04:54 (GMT)
commit3fdae5acaaa7ef29e8776e4dccde6102016624f6 (patch)
treef47d16339bdf750c80eae9200d2ddf1a7ab84153 /Source/cmGeneratorTarget.h
parent38332fc4facce48d6eaefdf55886a3e1eb85e659 (diff)
downloadCMake-3fdae5acaaa7ef29e8776e4dccde6102016624f6.zip
CMake-3fdae5acaaa7ef29e8776e4dccde6102016624f6.tar.gz
CMake-3fdae5acaaa7ef29e8776e4dccde6102016624f6.tar.bz2
Genex: Add generator expressions $<DEVICE_LINK> and $<HOST_LINK>
These generator expressions can only be used in link options properties. These expressions return the arguments respectively for device and host link step, otherwise return an empty string.
Diffstat (limited to 'Source/cmGeneratorTarget.h')
-rw-r--r--Source/cmGeneratorTarget.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 7cd253d..dd46bb9 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -204,6 +204,24 @@ public:
const char* GetLinkInterfaceDependentNumberMaxProperty(
const std::string& p, const std::string& config) const;
+ class DeviceLinkSetter
+ {
+ public:
+ DeviceLinkSetter(cmGeneratorTarget& target)
+ : Target(target)
+ {
+ this->PreviousState = target.SetDeviceLink(true);
+ }
+ ~DeviceLinkSetter() { this->Target.SetDeviceLink(this->PreviousState); };
+
+ private:
+ cmGeneratorTarget& Target;
+ bool PreviousState;
+ };
+
+ bool SetDeviceLink(bool deviceLink);
+ bool IsDeviceLink() const { return this->DeviceLink; }
+
cmLinkInterface const* GetLinkInterface(
const std::string& config, const cmGeneratorTarget* headTarget) const;
void ComputeLinkInterface(const std::string& config,
@@ -829,6 +847,7 @@ private:
mutable std::string LinkerLanguage;
using LinkClosureMapType = std::map<std::string, LinkClosure>;
mutable LinkClosureMapType LinkClosureMap;
+ bool DeviceLink = false;
// Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
const char* GetOutputTargetType(cmStateEnums::ArtifactType artifact) const;