summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMatthew Bentham <mjb67@artvps.com>2013-05-22 12:44:00 (GMT)
committerBrad King <brad.king@kitware.com>2013-05-22 15:48:01 (GMT)
commitbcda47d2a0673d46ffe209e3e0c07724eb6b8f5a (patch)
treeb92d8092f9e4547a3c992dfcfb26997eb95dd472 /Source
parent4825d70e830395ebff09a7fba73eb6ff5661048b (diff)
downloadCMake-bcda47d2a0673d46ffe209e3e0c07724eb6b8f5a.zip
CMake-bcda47d2a0673d46ffe209e3e0c07724eb6b8f5a.tar.gz
CMake-bcda47d2a0673d46ffe209e3e0c07724eb6b8f5a.tar.bz2
Xcode: Honor CMAKE_(MODULE|SHARED)_LINKER_FLAGS_<CONFIG> (#14161)
Refactor lookup of CMAKE_(EXE|MODULE|SHARED)_LINKER_FLAGS(|_<CONFIG>) variables to ensure all combinations are handled. Use the helper method AddConfigVariableFlags to simplify the implementation.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx30
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";