summaryrefslogtreecommitdiffstats
path: root/Source/cmLinkItem.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-19 22:57:35 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-20 22:52:22 (GMT)
commit91411641a7b8029d05899b11590fb4e676716a85 (patch)
tree0e550426997002746803ce767d882f91afb9ead3 /Source/cmLinkItem.h
parent6d94078e623d5f1316f1972ffda06ac1d66b6f2f (diff)
downloadCMake-91411641a7b8029d05899b11590fb4e676716a85.zip
CMake-91411641a7b8029d05899b11590fb4e676716a85.tar.gz
CMake-91411641a7b8029d05899b11590fb4e676716a85.tar.bz2
Move ComputeLinkType out of cmTarget.
Keep it out of the way, so that it does not become part of cmGeneratorTarget, but where it can be used to implement CMP0003.
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