summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.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/cmLocalGenerator.cxx
parentf154475b65738444414312d7d5a255f3220d90c6 (diff)
downloadCMake-84fdc9921cab35addba8c57cd201778de2cf87a4.zip
CMake-84fdc9921cab35addba8c57cd201778de2cf87a4.tar.gz
CMake-84fdc9921cab35addba8c57cd201778de2cf87a4.tar.bz2
stringapi: Pass configuration names as strings
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx38
1 files changed, 19 insertions, 19 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index e36266a..cd9f9bd 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -280,7 +280,7 @@ void cmLocalGenerator::GenerateTestFiles()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- const char* config =
+ const std::string& config =
this->Makefile->GetConfigurations(configurationTypes, false);
std::string file = this->Makefile->GetStartOutputDirectory();
@@ -384,11 +384,11 @@ void cmLocalGenerator::GenerateInstallRules()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- const char* config =
+ const std::string& config =
this->Makefile->GetConfigurations(configurationTypes, false);
// Choose a default install configuration.
- const char* default_config = config;
+ const char* default_config = config.c_str();
const char* default_order[] = {"RELEASE", "MINSIZEREL",
"RELWITHDEBINFO", "DEBUG", 0};
for(const char** c = default_order; *c && !default_config; ++c)
@@ -557,7 +557,7 @@ void cmLocalGenerator::GenerateTargetManifest()
}
if(configNames.empty())
{
- target.GenerateTargetManifest(0);
+ target.GenerateTargetManifest("");
}
else
{
@@ -712,8 +712,8 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
vars.LinkFlags = linkFlags.c_str();
std::string langFlags;
- this->AddLanguageFlags(langFlags, llang, 0);
- this->AddArchitectureFlags(langFlags, &target, llang, 0);
+ this->AddLanguageFlags(langFlags, llang, "");
+ this->AddArchitectureFlags(langFlags, &target, llang, "");
vars.LanguageCompileFlags = langFlags.c_str();
cmCustomCommandLines commandLines;
@@ -1292,7 +1292,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
cmGeneratorTarget* target,
const std::string& lang,
bool forResponseFile,
- const char *config)
+ const std::string& config)
{
if(lang.empty())
{
@@ -1370,7 +1370,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
if(!flagUsed || repeatFlag)
{
if(sysIncludeFlag && target &&
- target->IsSystemIncludeDirectory(i->c_str(), config))
+ target->IsSystemIncludeDirectory(*i, config))
{
includeFlags << sysIncludeFlag;
}
@@ -1405,7 +1405,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
//----------------------------------------------------------------------------
void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
cmTarget const* target,
- const char* config)
+ const std::string& config)
{
std::vector<std::string> targetDefines;
target->GetCompileDefinitions(targetDefines,
@@ -1416,7 +1416,7 @@ void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
//----------------------------------------------------------------------------
void cmLocalGenerator::AddCompileOptions(
std::string& flags, cmTarget* target,
- const std::string& lang, const char* config
+ const std::string& lang, const std::string& config
)
{
std::string langFlagRegexVar = std::string("CMAKE_")+lang+"_FLAG_REGEX";
@@ -1465,7 +1465,7 @@ void cmLocalGenerator::AddCompileOptions(
void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget* target,
const std::string& lang,
- const char *config,
+ const std::string& config,
bool stripImplicitInclDirs
)
{
@@ -1698,7 +1698,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
target->Target->GetName().c_str());
return;
}
- this->AddLanguageFlags(flags, linkLanguage, buildType.c_str());
+ this->AddLanguageFlags(flags, linkLanguage, buildType);
this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
*target, false, false);
if(cmSystemTools::IsOn
@@ -1945,7 +1945,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
cmGeneratorTarget* target,
const std::string& lang,
- const char* config)
+ const std::string& config)
{
// Only add Mac OS X specific flags on Darwin platforms (OSX and iphone):
if(!this->Makefile->IsOn("APPLE"))
@@ -2002,7 +2002,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
//----------------------------------------------------------------------------
void cmLocalGenerator::AddLanguageFlags(std::string& flags,
const std::string& lang,
- const char* config)
+ const std::string& config)
{
// Add language-specific flags.
std::string flagsVar = "CMAKE_";
@@ -2013,7 +2013,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
//----------------------------------------------------------------------------
bool cmLocalGenerator::GetRealDependency(const std::string& inName,
- const char* config,
+ const std::string& config,
std::string& dep)
{
// Older CMake code may specify the dependency using the target
@@ -2211,7 +2211,7 @@ void cmLocalGenerator
//----------------------------------------------------------------------------
void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target,
std::string const& lang,
- const char *config)
+ const std::string& config)
{
int targetType = target->GetType();
@@ -2327,13 +2327,13 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
//----------------------------------------------------------------------------
void cmLocalGenerator::AddConfigVariableFlags(std::string& flags,
const std::string& var,
- const char* config)
+ const std::string& config)
{
// Add the flags from the variable itself.
std::string flagsVar = var;
this->AppendFlags(flags, this->Makefile->GetDefinition(flagsVar.c_str()));
// Add the flags from the build-type specific variable.
- if(config && *config)
+ if(!config.empty())
{
flagsVar += "_";
flagsVar += cmSystemTools::UpperCase(config);
@@ -2837,7 +2837,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
void
cmLocalGenerator
::GenerateTargetInstallRules(
- std::ostream& os, const char* config,
+ std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes)
{
// Convert the old-style install specification from each target to