Merge topic 'xcode-shared-linker-flags-per-config'

bcda47d Xcode: Honor CMAKE_(MODULE|SHARED)_LINKER_FLAGS_<CONFIG> (#14161)
This commit is contained in:
Brad King 2013-05-23 10:52:17 -04:00 committed by CMake Topic Stage
commit 79e40f830f
1 changed files with 13 additions and 17 deletions

View File

@ -1716,30 +1716,26 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
buildSettings->AddAttribute buildSettings->AddAttribute
("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList()); ("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList());
std::string extraLinkOptionsVar;
std::string extraLinkOptions; std::string extraLinkOptions;
if(target.GetType() == cmTarget::EXECUTABLE) if(target.GetType() == cmTarget::EXECUTABLE)
{ {
extraLinkOptions = extraLinkOptionsVar = "CMAKE_EXE_LINKER_FLAGS";
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;
}
} }
if(target.GetType() == cmTarget::SHARED_LIBRARY) else if(target.GetType() == cmTarget::SHARED_LIBRARY)
{ {
extraLinkOptions = this->CurrentMakefile-> extraLinkOptionsVar = "CMAKE_SHARED_LINKER_FLAGS";
GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS");
} }
if(target.GetType() == cmTarget::MODULE_LIBRARY) else if(target.GetType() == cmTarget::MODULE_LIBRARY)
{ {
extraLinkOptions = this->CurrentMakefile-> extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS";
GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS"); }
if(extraLinkOptionsVar.size())
{
this->CurrentLocalGenerator
->AddConfigVariableFlags(extraLinkOptions,
extraLinkOptionsVar.c_str(),
configName);
} }
const char* linkFlagsProp = "LINK_FLAGS"; const char* linkFlagsProp = "LINK_FLAGS";