diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-09-22 02:59:55 (GMT) |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-10-02 17:30:43 (GMT) |
commit | fec4b637148bf6dca4b1d532ad0c1332c3038ea8 (patch) | |
tree | 57a8574e8e229756806b5f42ad3dab4517fa71dd /Source/cmLocalGenerator.cxx | |
parent | 557956f3489dbc75c7b6d26ed531c7c577aac146 (diff) | |
download | CMake-fec4b637148bf6dca4b1d532ad0c1332c3038ea8.zip CMake-fec4b637148bf6dca4b1d532ad0c1332c3038ea8.tar.gz CMake-fec4b637148bf6dca4b1d532ad0c1332c3038ea8.tar.bz2 |
Fix configuration-dependent flag lookup in cmLocalGenerator::GetTargetFlags
Specifically, perform configuration-dependent lookup of
STATIC_LIBRARY_FLAGS for static libraries, and use the correct prefix
for configuration-dependent lookup of LINK_FLAGS (i.e. "LINK_FLAGS_",
as opposed to the value of the LINK_FLAGS property).
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index aeda164..65d6fa6 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1463,6 +1463,17 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, linkFlags += targetLinkFlags; linkFlags += " "; } + if(!buildType.empty()) + { + std::string build = "STATIC_LIBRARY_FLAGS_"; + build += buildType; + targetLinkFlags = target.GetProperty(build.c_str()); + if(targetLinkFlags) + { + linkFlags += targetLinkFlags; + linkFlags += " "; + } + } } break; case cmTarget::MODULE_LIBRARY: @@ -1471,7 +1482,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, { linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable); linkFlags += " "; - if(buildType.size()) + if(!buildType.empty()) { std::string build = libraryLinkVariable; build += "_"; @@ -1502,7 +1513,10 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, { linkFlags += targetLinkFlags; linkFlags += " "; - std::string configLinkFlags = targetLinkFlags; + } + if(!buildType.empty()) + { + std::string configLinkFlags = "LINK_FLAGS_"; configLinkFlags += buildType; targetLinkFlags = target.GetProperty(configLinkFlags.c_str()); if(targetLinkFlags) @@ -1521,7 +1535,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, linkFlags += this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS"); linkFlags += " "; - if(buildType.size()) + if(!buildType.empty()) { std::string build = "CMAKE_EXE_LINKER_FLAGS_"; build += buildType; @@ -1573,8 +1587,11 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, if(targetLinkFlags) { linkFlags += targetLinkFlags; - linkFlags += " "; - std::string configLinkFlags = targetLinkFlags; + linkFlags += " "; + } + if(!buildType.empty()) + { + std::string configLinkFlags = "LINK_FLAGS_"; configLinkFlags += buildType; targetLinkFlags = target.GetProperty(configLinkFlags.c_str()); if(targetLinkFlags) |