diff options
author | Brad King <brad.king@kitware.com> | 2013-05-23 14:52:17 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-05-23 14:52:17 (GMT) |
commit | 79e40f830f4b2ab31b39af604322b7c7a002d1c6 (patch) | |
tree | 44667b8da5a9175cfb9304dec45785f73535aebd /Source/cmGlobalXCodeGenerator.cxx | |
parent | 5361270c6e9898b7ea10854ae101301772cd9b7d (diff) | |
parent | bcda47d2a0673d46ffe209e3e0c07724eb6b8f5a (diff) | |
download | CMake-79e40f830f4b2ab31b39af604322b7c7a002d1c6.zip CMake-79e40f830f4b2ab31b39af604322b7c7a002d1c6.tar.gz CMake-79e40f830f4b2ab31b39af604322b7c7a002d1c6.tar.bz2 |
Merge topic 'xcode-shared-linker-flags-per-config'
bcda47d Xcode: Honor CMAKE_(MODULE|SHARED)_LINKER_FLAGS_<CONFIG> (#14161)
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 870bfa1..c739dcb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1716,30 +1716,26 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, buildSettings->AddAttribute ("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList()); + std::string extraLinkOptionsVar; std::string extraLinkOptions; if(target.GetType() == cmTarget::EXECUTABLE) { - extraLinkOptions = - this->CurrentMakefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS"); - std::string var = "CMAKE_EXE_LINKER_FLAGS_"; - var += cmSystemTools::UpperCase(configName); - std::string val = - this->CurrentMakefile->GetSafeDefinition(var.c_str()); - if(val.size()) - { - extraLinkOptions += " "; - extraLinkOptions += val; - } + extraLinkOptionsVar = "CMAKE_EXE_LINKER_FLAGS"; } - if(target.GetType() == cmTarget::SHARED_LIBRARY) + else if(target.GetType() == cmTarget::SHARED_LIBRARY) + { + extraLinkOptionsVar = "CMAKE_SHARED_LINKER_FLAGS"; + } + else if(target.GetType() == cmTarget::MODULE_LIBRARY) { - extraLinkOptions = this->CurrentMakefile-> - GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS"); + extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS"; } - if(target.GetType() == cmTarget::MODULE_LIBRARY) + if(extraLinkOptionsVar.size()) { - extraLinkOptions = this->CurrentMakefile-> - GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS"); + this->CurrentLocalGenerator + ->AddConfigVariableFlags(extraLinkOptions, + extraLinkOptionsVar.c_str(), + configName); } const char* linkFlagsProp = "LINK_FLAGS"; |