summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-09 18:12:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-09 19:52:52 (GMT)
commit3b8e56a50f7f608f7a93f8ecf23392cc2cda4868 (patch)
treee3eaf270a2402931430613b57af96c3919868eae /Source/cmTarget.cxx
parent330af68ed4eca375160b31aefd71bd6ea11b586f (diff)
downloadCMake-3b8e56a50f7f608f7a93f8ecf23392cc2cda4868.zip
CMake-3b8e56a50f7f608f7a93f8ecf23392cc2cda4868.tar.gz
CMake-3b8e56a50f7f608f7a93f8ecf23392cc2cda4868.tar.bz2
Don't search for IMPORTED_LOCATION of INTERFACE_LIBRARY (14636)
The INTERFACE_LIBRARY type does not have any LOCATION at all, so return early from GetMappedConfig. GetMappedConfig is called from two locations, one of which already pre-checks the INTERFACE_LIBRARY case. Remove that pre-check and handle that case inside the method instead.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 38fe945..51ee31a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4860,6 +4860,15 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
const char** imp,
std::string& suffix) const
{
+ if (this->GetType() == INTERFACE_LIBRARY)
+ {
+ // This method attempts to find a config-specific LOCATION for the
+ // IMPORTED library. In the case of INTERFACE_LIBRARY, there is no
+ // LOCATION at all, so leaving *loc and *imp unchanged is the appropriate
+ // and valid response.
+ return true;
+ }
+
// Track the configuration-specific property suffix.
suffix = "_";
suffix += desired_config;
@@ -4992,8 +5001,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
const char* loc = 0;
const char* imp = 0;
std::string suffix;
- if (this->GetType() != INTERFACE_LIBRARY &&
- !this->GetMappedConfig(desired_config, &loc, &imp, suffix))
+ if (!this->GetMappedConfig(desired_config, &loc, &imp, suffix))
{
return;
}