summaryrefslogtreecommitdiffstats
path: root/Source/cmLinkItem.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-10-21 13:17:01 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-10-21 13:17:01 (GMT)
commit9206120e30d91389470aa0908965103dc301bbae (patch)
tree8e87d98a885f35995d212fb229eb98ba81388b8f /Source/cmLinkItem.h
parentd31d92bf1d8b13ddff2c85c1fd380519867b788c (diff)
parentc099e00fc0a9c47a2addaca145952b1c33195fab (diff)
downloadCMake-9206120e30d91389470aa0908965103dc301bbae.zip
CMake-9206120e30d91389470aa0908965103dc301bbae.tar.gz
CMake-9206120e30d91389470aa0908965103dc301bbae.tar.bz2
Merge topic 'use-generator-target'
c099e00f Access policy status from cmGeneratorTarget at generate time. d74bca5a cmGeneratorTarget: Copy the policy map from the cmTarget. c6e86955 cmTarget: Remove unused NameResolvesToFramework. 18046bd5 cmCommonTargetGenerator: Use NameResolvesToFramework without cmTarget. 91411641 Move ComputeLinkType out of cmTarget. 6d94078e cmGeneratorTarget: Move IsDLLPlatform from cmTarget. 3ebc6285 cmGeneratorTarget: Move HaveWellDefinedOutputFiles from cmTarget. 311018e5 cmGeneratorTarget: Move GetExportMacro from cmTarget. 215cd21a cmGeneratorTarget: Provide direct access to the backtrace. 1df8bd3a cmGlobalGenerator: Port IsRootOnlyTarget to cmGeneratorTarget. 83703bda cmGeneratorTarget: Copy IsExecutableWithExports from cmTarget.
Diffstat (limited to 'Source/cmLinkItem.h')
-rw-r--r--Source/cmLinkItem.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index b875cc0..b603bcc 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -14,6 +14,7 @@
#define cmLinkItem_h
#include "cmListFileCache.h"
+#include "cmSystemTools.h"
class cmGeneratorTarget;
@@ -118,4 +119,27 @@ struct cmOptionalLinkImplementation: public cmLinkImplementation
bool HadHeadSensitiveCondition;
};
+/** Compute the link type to use for the given configuration. */
+inline cmTargetLinkLibraryType
+CMP0003_ComputeLinkType(const std::string& config,
+ std::vector<std::string> const& debugConfigs)
+{
+ // No configuration is always optimized.
+ if(config.empty())
+ {
+ return OPTIMIZED_LibraryType;
+ }
+
+ // Check if any entry in the list matches this configuration.
+ std::string configUpper = cmSystemTools::UpperCase(config);
+ if (std::find(debugConfigs.begin(), debugConfigs.end(), configUpper) !=
+ debugConfigs.end())
+ {
+ return DEBUG_LibraryType;
+ }
+ // The current configuration is not a debug configuration.
+ return OPTIMIZED_LibraryType;
+}
+
+
#endif