diff options
Diffstat (limited to 'Source/cmLinkItem.h')
-rw-r--r-- | Source/cmLinkItem.h | 24 |
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 |