diff options
author | Patrick Gansterer <paroga@paroga.com> | 2013-07-10 17:11:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-07-31 12:41:07 (GMT) |
commit | 14bbf8340ac4d285b61afb5b61ebc4c730f4b4fa (patch) | |
tree | f8ee4cb65582a6135748647e7830d28e66fc30d0 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 8d3b65346f112d2d21efd3105f4d1535adc2935e (diff) | |
download | CMake-14bbf8340ac4d285b61afb5b61ebc4c730f4b4fa.zip CMake-14bbf8340ac4d285b61afb5b61ebc4c730f4b4fa.tar.gz CMake-14bbf8340ac4d285b61afb5b61ebc4c730f4b4fa.tar.bz2 |
Unify the way the flags of a static library are read
Introduce cmLocalGenerator::GetStaticLibraryFlags() to have a central
function for getting the linker flags for a given target.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 63de1a5..7cb2d1f 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1769,27 +1769,31 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, configName); } - const char* linkFlagsProp = "LINK_FLAGS"; if(target.GetType() == cmTarget::OBJECT_LIBRARY || target.GetType() == cmTarget::STATIC_LIBRARY) { - linkFlagsProp = "STATIC_LIBRARY_FLAGS"; - } - const char* targetLinkFlags = target.GetProperty(linkFlagsProp); - if(targetLinkFlags) - { - extraLinkOptions += " "; - extraLinkOptions += targetLinkFlags; + this->CurrentLocalGenerator + ->GetStaticLibraryFlags(extraLinkOptions, + cmSystemTools::UpperCase(configName), + &target); } - if(configName && *configName) + else { - std::string linkFlagsVar = linkFlagsProp; - linkFlagsVar += "_"; - linkFlagsVar += cmSystemTools::UpperCase(configName); - if(const char* linkFlags = target.GetProperty(linkFlagsVar.c_str())) + const char* targetLinkFlags = target.GetProperty("LINK_FLAGS"); + if(targetLinkFlags) { - extraLinkOptions += " "; - extraLinkOptions += linkFlags; + this->CurrentLocalGenerator-> + AppendFlags(extraLinkOptions, targetLinkFlags); + } + if(configName && *configName) + { + std::string linkFlagsVar = "LINK_FLAGS_"; + linkFlagsVar += cmSystemTools::UpperCase(configName); + if(const char* linkFlags = target.GetProperty(linkFlagsVar.c_str())) + { + this->CurrentLocalGenerator-> + AppendFlags(extraLinkOptions, linkFlags); + } } } |