summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-09-04 21:34:25 (GMT)
committerBrad King <brad.king@kitware.com>2008-09-04 21:34:25 (GMT)
commit3c5cf1bb8c4e146f3d3d177f2be9dc53869f5d74 (patch)
tree6705b688a2fcfe98ffaa27afba37b77244cdbf01 /Source/cmTarget.cxx
parentbf796f1434fd049ec77f7df5d4b8126b0d6ab96a (diff)
downloadCMake-3c5cf1bb8c4e146f3d3d177f2be9dc53869f5d74.zip
CMake-3c5cf1bb8c4e146f3d3d177f2be9dc53869f5d74.tar.gz
CMake-3c5cf1bb8c4e146f3d3d177f2be9dc53869f5d74.tar.bz2
ENH: Allow a custom list of debug configurations
Create a DEBUG_CONFIGURATIONS global property as a way for projects to specify which configuration names are considered to be 'debug' configurations.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx34
1 files changed, 29 insertions, 5 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0fbae69..177db54 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1257,6 +1257,34 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories()
}
//----------------------------------------------------------------------------
+cmTarget::LinkLibraryType cmTarget::ComputeLinkType(const char* config)
+{
+ // No configuration is always optimized.
+ if(!(config && *config))
+ {
+ return cmTarget::OPTIMIZED;
+ }
+
+ // Get the list of configurations considered to be DEBUG.
+ std::vector<std::string> const& debugConfigs =
+ this->Makefile->GetCMakeInstance()->GetDebugConfigs();
+
+ // Check if any entry in the list matches this configuration.
+ std::string configUpper = cmSystemTools::UpperCase(config);
+ for(std::vector<std::string>::const_iterator i = debugConfigs.begin();
+ i != debugConfigs.end(); ++i)
+ {
+ if(*i == configUpper)
+ {
+ return cmTarget::DEBUG;
+ }
+ }
+
+ // The current configuration is not a debug configuration.
+ return cmTarget::OPTIMIZED;
+}
+
+//----------------------------------------------------------------------------
void cmTarget::ClearDependencyInformation( cmMakefile& mf,
const char* target )
{
@@ -3620,11 +3648,7 @@ cmTargetLinkInterface* cmTarget::ComputeLinkInterface(const char* config)
}
// Compute which library configuration to link.
- cmTarget::LinkLibraryType linkType = cmTarget::OPTIMIZED;
- if(config && cmSystemTools::UpperCase(config) == "DEBUG")
- {
- linkType = cmTarget::DEBUG;
- }
+ cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
// Construct the list of libs linked for this configuration.
cmTarget::LinkLibraryVectorType const& llibs =