summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-10 03:48:34 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:36 (GMT)
commit84fdc9921cab35addba8c57cd201778de2cf87a4 (patch)
treea43cc1d2782da4bd54734beb3fa5494048a08a18 /Source/cmGlobalXCodeGenerator.cxx
parentf154475b65738444414312d7d5a255f3220d90c6 (diff)
downloadCMake-84fdc9921cab35addba8c57cd201778de2cf87a4.zip
CMake-84fdc9921cab35addba8c57cd201778de2cf87a4.tar.gz
CMake-84fdc9921cab35addba8c57cd201778de2cf87a4.tar.bz2
stringapi: Pass configuration names as strings
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx27
1 files changed, 11 insertions, 16 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 08e9adf..c0077b9 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -264,7 +264,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
const std::string& projectName,
const char* /*projectDir*/,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool /*fast*/,
std::vector<std::string> const& makeOptions)
{
@@ -298,11 +298,6 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
makeCommand.push_back("build");
}
makeCommand.push_back("-target");
- // if it is a null string for config don't use it
- if(config && *config == 0)
- {
- config = 0;
- }
if (!realTarget.empty())
{
makeCommand.push_back(realTarget);
@@ -319,7 +314,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
else
{
makeCommand.push_back("-configuration");
- makeCommand.push_back(config?config:"Debug");
+ makeCommand.push_back(!config.empty()?config:"Debug");
}
makeCommand.insert(makeCommand.end(),
makeOptions.begin(), makeOptions.end());
@@ -1547,7 +1542,7 @@ void cmGlobalXCodeGenerator
cmTarget& target,
std::vector<cmCustomCommand>
const & commands,
- const char* configName,
+ const std::string& configName,
const std::map<std::string,
std::string>& multipleOutputPairs
)
@@ -1690,8 +1685,8 @@ void cmGlobalXCodeGenerator
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
- cmXCodeObject* buildSettings,
- const char* configName)
+ cmXCodeObject* buildSettings,
+ const std::string& configName)
{
if(target.GetType() == cmTarget::INTERFACE_LIBRARY)
{
@@ -1804,7 +1799,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CurrentLocalGenerator->
AppendFlags(extraLinkOptions, targetLinkFlags);
}
- if(configName && *configName)
+ if(!configName.empty())
{
std::string linkFlagsVar = "LINK_FLAGS_";
linkFlagsVar += cmSystemTools::UpperCase(configName);
@@ -2738,7 +2733,7 @@ void cmGlobalXCodeGenerator
::AppendBuildSettingAttribute(cmXCodeObject* target,
const char* attribute,
const char* value,
- const char* configName)
+ const std::string& configName)
{
if(this->XcodeVersion < 21)
{
@@ -2761,9 +2756,9 @@ void cmGlobalXCodeGenerator
for(std::vector<cmXCodeObject*>::iterator i = list.begin();
i != list.end(); ++i)
{
- if(configName)
+ if(!configName.empty())
{
- if(strcmp((*i)->GetObject("name")->GetString(), configName) == 0)
+ if((*i)->GetObject("name")->GetString() == configName)
{
cmXCodeObject* settings = (*i)->GetObject("buildSettings");
this->AppendOrAddBuildSetting(settings, attribute, value);
@@ -3777,13 +3772,13 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
void
cmGlobalXCodeGenerator
::AppendDirectoryForConfig(const char* prefix,
- const char* config,
+ const std::string& config,
const char* suffix,
std::string& dir)
{
if(this->XcodeVersion > 20)
{
- if(config)
+ if(!config.empty())
{
dir += prefix;
dir += config;