diff options
author | Brad King <brad.king@kitware.com> | 2014-03-09 10:29:02 -0400 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-03-09 10:29:02 -0400 |
commit | ad9f0d831e6522d9606bab7ae08559cebeed83ce (patch) | |
tree | d85ba309d378fac37063e7b05fc624e60a819a64 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 6aad93f407f341fae1afb80ebeab532451c39458 (diff) | |
parent | b633b263082ae2c74a030aefb9048b0a20098b61 (diff) | |
download | cmake-ad9f0d831e6522d9606bab7ae08559cebeed83ce.tar.gz |
Merge topic 'dev/string-apis'
b633b263 CPackWiX: Fix test to build with expected config
191f25e2 stringapi: Prevent a NULL dereference in WiX
219d6ad6 speedup: Avoid excess iterator dereferences
caaad357 speedup: Cache strings for comparisons
7abf4e31 stringapi: Use strings for dependency information
94fc63e2 stringapi: Use strings for cache iterator values
85fc9f26 stringapi: Command names
6557382d stringapi: Use strings for program paths
1a1b737c stringapi: Use strings for generator names
24b5e93d stringapi: Use strings for directories
11ed3e2c stringapi: Add string overload for the Def struct
b3bf31a5 stringapi: Miscellaneous char* parameters
5af95c39 typo: Match argument name with the header
2b17626e stringapi: Pass strings as install directories in CPack
3def29da stringapi: Use strings for feature arguments
acb116e3 stringapi: Return a string reference for the configuration
...
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 202 |
1 files changed, 96 insertions, 106 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 004f7acf1d..30a2a1ec3b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -34,17 +34,17 @@ class cmXcodeVersionParser : public cmXMLParser { public: cmXcodeVersionParser(): Version("1.5") {} - void StartElement(const char* , const char** ) + void StartElement(const std::string&, const char**) { this->Data = ""; } - void EndElement(const char* name) + void EndElement(const std::string& name) { - if(strcmp(name, "key") == 0) + if(name == "key") { this->Key = this->Data; } - else if(strcmp(name, "string") == 0) + else if(name == "string") { if(this->Key == "CFBundleShortVersionString") { @@ -116,7 +116,8 @@ public: class cmGlobalXCodeGenerator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const; + virtual cmGlobalGenerator* CreateGlobalGenerator( + const std::string& name) const; virtual void GetDocumentation(cmDocumentationEntry& entry) const { cmGlobalXCodeGenerator::GetDocumentation(entry); } @@ -152,9 +153,9 @@ cmGlobalGeneratorFactory* cmGlobalXCodeGenerator::NewFactory() //---------------------------------------------------------------------------- cmGlobalGenerator* cmGlobalXCodeGenerator::Factory -::CreateGlobalGenerator(const char* name) const +::CreateGlobalGenerator(const std::string& name) const { - if (strcmp(name, GetActualName())) + if (name != GetActualName()) return 0; #if defined(CMAKE_BUILD_WITH_CMAKE) cmXcodeVersionParser parser; @@ -260,11 +261,11 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const& void cmGlobalXCodeGenerator::GenerateBuildCommand( std::vector<std::string>& makeCommand, - const char* makeProgram, - const char* projectName, - const char* /*projectDir*/, - const char* targetName, - const char* config, + const std::string& makeProgram, + const std::string& projectName, + const std::string& /*projectDir*/, + const std::string& targetName, + const std::string& config, bool /*fast*/, std::vector<std::string> const& makeOptions) { @@ -283,10 +284,11 @@ cmGlobalXCodeGenerator::GenerateBuildCommand( makeCommand.push_back(projectArg); bool clean = false; - if ( targetName && strcmp(targetName, "clean") == 0 ) + std::string realTarget = targetName; + if ( realTarget == "clean" ) { clean = true; - targetName = "ALL_BUILD"; + realTarget = "ALL_BUILD"; } if(clean) { @@ -297,14 +299,9 @@ 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) + if (!realTarget.empty()) { - config = 0; - } - if (targetName && strlen(targetName)) - { - makeCommand.push_back(targetName); + makeCommand.push_back(realTarget); } else { @@ -318,7 +315,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()); @@ -336,7 +333,7 @@ cmLocalGenerator *cmGlobalXCodeGenerator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::Generate() { - std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it; + std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it; // make sure extra targets are added before calling // the parent generate which will call trace depends for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it) @@ -569,7 +566,7 @@ void cmGlobalXCodeGenerator::addObject(cmXCodeObject *obj) { if(obj->GetType() == cmXCodeObject::OBJECT) { - cmStdString id = obj->GetId(); + std::string id = obj->GetId(); // If this is a duplicate id, it's an error: // @@ -613,7 +610,7 @@ cmGlobalXCodeGenerator::CreateObject(cmXCodeObject::Type type) //---------------------------------------------------------------------------- cmXCodeObject* -cmGlobalXCodeGenerator::CreateString(const char* s) +cmGlobalXCodeGenerator::CreateString(const std::string& s) { cmXCodeObject* obj = this->CreateObject(cmXCodeObject::STRING); obj->SetString(s); @@ -630,17 +627,17 @@ cmXCodeObject* cmGlobalXCodeGenerator } //---------------------------------------------------------------------------- -cmStdString +std::string GetGroupMapKeyFromPath(cmTarget& cmtarget, const std::string& fullpath) { - cmStdString key(cmtarget.GetName()); + std::string key(cmtarget.GetName()); key += "-"; key += fullpath; return key; } //---------------------------------------------------------------------------- -cmStdString +std::string GetGroupMapKey(cmTarget& cmtarget, cmSourceFile* sf) { return GetGroupMapKeyFromPath(cmtarget, sf->GetFullPath()); @@ -696,12 +693,8 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, flags += flagsBuild.GetString(); } - const char* lang = + std::string lang = this->CurrentLocalGenerator->GetSourceFileLanguage(*sf); - if (!lang) - { - lang = ""; - } cmXCodeObject* buildFile = this->CreateXCodeSourceFileFromPath(sf->GetFullPath(), cmtarget, lang); @@ -847,7 +840,7 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( fileRef->SetComment(fname.c_str()); this->FileRefs[fname] = fileRef; } - cmStdString key = GetGroupMapKeyFromPath(cmtarget, fullpath); + std::string key = GetGroupMapKeyFromPath(cmtarget, fullpath); cmXCodeObject* group = this->GroupMap[key]; cmXCodeObject* children = group->GetObject("children"); if (!children->HasObject(fileRef)) @@ -906,12 +899,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf, cmTarget& cmtarget) { - const char* lang = + std::string lang = this->CurrentLocalGenerator->GetSourceFileLanguage(*sf); - if (!lang) - { - lang = ""; - } return this->CreateXCodeFileReferenceFromPath( sf->GetFullPath(), cmtarget, lang); @@ -1017,7 +1006,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, gtgt->GetTargetSourceFileFlags(*i); if(filetype && - strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0) + filetype->GetString() == "compiled.mach-o.objfile") { externalObjFiles.push_back(xsf); } @@ -1036,7 +1025,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // Include this file in the build if it has a known language // and has not been listed as an ignored extension for this // generator. - if(this->CurrentLocalGenerator->GetSourceFileLanguage(**i) && + if(!this->CurrentLocalGenerator->GetSourceFileLanguage(**i).empty() && !this->IgnoreFile((*i)->GetExtension().c_str())) { sourceFiles.push_back(xsf); @@ -1134,7 +1123,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, std::vector<cmXCodeObject*> contentBuildPhases; if (isFrameworkTarget || isBundleTarget || isCFBundleTarget) { - typedef std::map<cmStdString, std::vector<cmSourceFile*> > + typedef std::map<std::string, std::vector<cmSourceFile*> > mapOfVectorOfSourceFiles; mapOfVectorOfSourceFiles bundleFiles; for(std::vector<cmSourceFile*>::const_iterator i = classes.begin(); @@ -1223,7 +1212,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, void cmGlobalXCodeGenerator::ForceLinkerLanguages() { // This makes sure all targets link using the proper language. - for(std::map<cmStdString, cmTarget*>::const_iterator + for(std::map<std::string, cmTarget*>::const_iterator ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti) { this->ForceLinkerLanguage(*ti->second); @@ -1241,8 +1230,8 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget) return; } - const char* llang = cmtarget.GetLinkerLanguage("NOCONFIG"); - if(!llang) { return; } + std::string llang = cmtarget.GetLinkerLanguage("NOCONFIG"); + if(llang.empty()) { return; } // If the language is compiled as a source trust Xcode to link with it. cmTarget::LinkImplementation const* impl = @@ -1270,7 +1259,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget) } if(cmSourceFile* sf = mf->GetOrCreateSource(fname.c_str())) { - sf->SetProperty("LANGUAGE", llang); + sf->SetProperty("LANGUAGE", llang.c_str()); cmtarget.AddSourceFile(sf); } } @@ -1484,7 +1473,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase, // collect multiple outputs of custom commands into a set // which will be used for every configuration - std::map<cmStdString, cmStdString> multipleOutputPairs; + std::map<std::string, std::string> multipleOutputPairs; for(std::vector<cmCustomCommand>::const_iterator i = commands.begin(); i != commands.end(); ++i) { @@ -1554,9 +1543,9 @@ void cmGlobalXCodeGenerator cmTarget& target, std::vector<cmCustomCommand> const & commands, - const char* configName, - const std::map<cmStdString, - cmStdString>& multipleOutputPairs + const std::string& configName, + const std::map<std::string, + std::string>& multipleOutputPairs ) { std::string makefileName=makefileBasename; @@ -1578,7 +1567,7 @@ void cmGlobalXCodeGenerator // have all depend on all outputs makefileStream << "all: "; - std::map<const cmCustomCommand*, cmStdString> tname; + std::map<const cmCustomCommand*, std::string> tname; int count = 0; for(std::vector<cmCustomCommand>::const_iterator i = commands.begin(); i != commands.end(); ++i) @@ -1676,7 +1665,7 @@ void cmGlobalXCodeGenerator makefileStream << "\n# Dependencies of multiple outputs to their primary outputs \n"; - for(std::map<cmStdString, cmStdString>::const_iterator o = + for(std::map<std::string, std::string>::const_iterator o = multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o) { makefileStream << o->first << ": " << o->second << "\n"; @@ -1685,7 +1674,7 @@ void cmGlobalXCodeGenerator makefileStream << "\n" "cmake_check_multiple_outputs:\n"; - for(std::map<cmStdString, cmStdString>::const_iterator o = + for(std::map<std::string, std::string>::const_iterator o = multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o) { makefileStream << "\t@if [ ! -f " @@ -1697,8 +1686,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) { @@ -1714,12 +1703,12 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, (target.GetType() == cmTarget::EXECUTABLE) || shared); - const char* lang = target.GetLinkerLanguage(configName); + std::string lang = target.GetLinkerLanguage(configName); std::string cflags; - if(lang) + if(!lang.empty()) { // for c++ projects get the c flags as well - if(strcmp(lang, "CXX") == 0) + if(lang == "CXX") { this->CurrentLocalGenerator->AddLanguageFlags(cflags, "C", configName); this->CurrentLocalGenerator->AddCMP0018Flags(cflags, &target, @@ -1745,7 +1734,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { cmSystemTools::Error ("CMake can not determine linker language for target: ", - target.GetName()); + target.GetName().c_str()); return; } @@ -1811,7 +1800,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); @@ -2095,7 +2084,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, std::vector<std::string> includes; this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt, "C", configName); - std::set<cmStdString> emitted; + std::set<std::string> emitted; emitted.insert("/System/Library/Frameworks"); for(std::vector<std::string>::iterator i = includes.begin(); i != includes.end(); ++i) @@ -2178,7 +2167,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, const char* debugStr = "YES"; // We can't set the Xcode flag differently depending on the language, // so put them back in this case. - if( (lang && strcmp(lang, "CXX") == 0) && gflag != gflagc ) + if( (lang == "CXX") && gflag != gflagc ) { cflags += " "; cflags += gflagc; @@ -2201,7 +2190,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, this->CreateString("NO")); buildSettings->AddAttribute("GCC_INLINES_ARE_PRIVATE_EXTERN", this->CreateString("NO")); - if(lang && strcmp(lang, "CXX") == 0) + if(lang == "CXX") { flags += " "; flags += defFlags; @@ -2364,18 +2353,18 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { if(i->first.find("XCODE_ATTRIBUTE_") == 0) { - cmStdString attribute = i->first.substr(16); + std::string attribute = i->first.substr(16); // Handle [variant=<config>] condition explicitly here. - cmStdString::size_type beginVariant = + std::string::size_type beginVariant = attribute.find("[variant="); - if (beginVariant != cmStdString::npos) + if (beginVariant != std::string::npos) { - cmStdString::size_type endVariant = + std::string::size_type endVariant = attribute.find("]", beginVariant+9); - if (endVariant != cmStdString::npos) + if (endVariant != std::string::npos) { // Compare the variant to the configuration. - cmStdString variant = + std::string variant = attribute.substr(beginVariant+9, endVariant-beginVariant-9); if (variant == configName) { @@ -2428,7 +2417,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget) cmXCodeObject* target = this->CreateObject(cmXCodeObject::PBXAggregateTarget); - target->SetComment(cmtarget.GetName()); + target->SetComment(cmtarget.GetName().c_str()); cmXCodeObject* buildPhases = this->CreateObject(cmXCodeObject::OBJECT_LIST); std::vector<cmXCodeObject*> emptyContentVector; @@ -2629,7 +2618,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget, fileRef->AddAttribute("refType", this->CreateString("0")); fileRef->AddAttribute("sourceTree", this->CreateString("BUILT_PRODUCTS_DIR")); - fileRef->SetComment(cmtarget.GetName()); + fileRef->SetComment(cmtarget.GetName().c_str()); target->AddAttribute("productReference", this->CreateObjectReference(fileRef)); if(const char* productType = this->GetTargetProductType(cmtarget)) @@ -2662,8 +2651,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::FindXCodeTarget(cmTarget const* t) } //---------------------------------------------------------------------------- -std::string cmGlobalXCodeGenerator::GetOrCreateId(const char* name, - const char* id) +std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, + const std::string& id) { std::string guidStoreName = name; guidStoreName += "_GUID_CMAKE"; @@ -2676,7 +2665,7 @@ std::string cmGlobalXCodeGenerator::GetOrCreateId(const char* name, } this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), - id, "Stored Xcode object GUID", cmCacheManager::INTERNAL); + id.c_str(), "Stored Xcode object GUID", cmCacheManager::INTERNAL); return id; } @@ -2745,7 +2734,7 @@ void cmGlobalXCodeGenerator ::AppendBuildSettingAttribute(cmXCodeObject* target, const char* attribute, const char* value, - const char* configName) + const std::string& configName) { if(this->XcodeVersion < 21) { @@ -2768,9 +2757,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); @@ -2976,7 +2965,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, mf->FindSourceGroup(source.c_str(), sourceGroups); cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(cmtarget, sourceGroup); - cmStdString key = GetGroupMapKey(cmtarget, sf); + std::string key = GetGroupMapKey(cmtarget, sf); this->GroupMap[key] = pbxgroup; } @@ -2991,7 +2980,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, mf->FindSourceGroup(source.c_str(), sourceGroups); cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(cmtarget, sourceGroup); - cmStdString key = GetGroupMapKeyFromPath(cmtarget, source); + std::string key = GetGroupMapKeyFromPath(cmtarget, source); this->GroupMap[key] = pbxgroup; } } @@ -2999,7 +2988,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, } cmXCodeObject *cmGlobalXCodeGenerator -::CreatePBXGroup(cmXCodeObject *parent, cmStdString name) +::CreatePBXGroup(cmXCodeObject *parent, std::string name) { cmXCodeObject* parentChildren = NULL; if(parent) @@ -3023,8 +3012,8 @@ cmXCodeObject *cmGlobalXCodeGenerator cmXCodeObject* cmGlobalXCodeGenerator ::CreateOrGetPBXGroup(cmTarget& cmtarget, cmSourceGroup* sg) { - cmStdString s; - cmStdString target; + std::string s; + std::string target; const char *targetFolder= cmtarget.GetProperty("FOLDER"); if(targetFolder) { target = targetFolder; @@ -3033,7 +3022,7 @@ cmXCodeObject* cmGlobalXCodeGenerator target += cmtarget.GetName(); s = target + "/"; s += sg->GetFullName(); - std::map<cmStdString, cmXCodeObject* >::iterator it = + std::map<std::string, cmXCodeObject* >::iterator it = this->GroupNameMap.find(s); if(it != this->GroupNameMap.end()) { @@ -3050,7 +3039,7 @@ cmXCodeObject* cmGlobalXCodeGenerator { std::vector<std::string> tgt_folders = cmSystemTools::tokenize(target, "/"); - cmStdString curr_tgt_folder; + std::string curr_tgt_folder; for(std::vector<std::string>::size_type i = 0; i < tgt_folders.size();i++) { if (i != 0) @@ -3077,7 +3066,7 @@ cmXCodeObject* cmGlobalXCodeGenerator // If it's the default source group (empty name) then put the source file // directly in the tgroup... // - if (cmStdString(sg->GetFullName()) == "") + if (std::string(sg->GetFullName()) == "") { this->GroupNameMap[s] = tgroup; return tgroup; @@ -3088,12 +3077,12 @@ cmXCodeObject* cmGlobalXCodeGenerator { std::vector<std::string> folders = cmSystemTools::tokenize(sg->GetFullName(), "\\"); - cmStdString curr_folder = target; + std::string curr_folder = target; curr_folder += "/"; for(std::vector<std::string>::size_type i = 0; i < folders.size();i++) { curr_folder += folders[i]; - std::map<cmStdString, cmXCodeObject* >::iterator i_folder = + std::map<std::string, cmXCodeObject* >::iterator i_folder = this->GroupNameMap.find(curr_folder); //Create new folder if(i_folder == this->GroupNameMap.end()) @@ -3473,14 +3462,14 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( makefileStream << "# For each target create a dummy rule " "so the target does not have to exist\n"; - std::set<cmStdString> emitted; + std::set<std::string> emitted; for(std::vector<cmXCodeObject*>::iterator i = targets.begin(); i != targets.end(); ++i) { cmXCodeObject* target = *i; - std::map<cmStdString, cmXCodeObject::StringVec> const& deplibs = + std::map<std::string, cmXCodeObject::StringVec> const& deplibs = target->GetDependLibraries(); - for(std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator ci + for(std::map<std::string, cmXCodeObject::StringVec>::const_iterator ci = deplibs.begin(); ci != deplibs.end(); ++ci) { for(cmXCodeObject::StringVec::const_iterator d = ci->second.begin(); @@ -3536,12 +3525,12 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( std::string trel = this->ConvertToRelativeForMake(tfull.c_str()); // Add this target to the post-build phases of its dependencies. - std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator + std::map<std::string, cmXCodeObject::StringVec>::const_iterator y = target->GetDependTargets().find(*ct); if(y != target->GetDependTargets().end()) { - std::vector<cmStdString> const& deptgts = y->second; - for(std::vector<cmStdString>::const_iterator d = deptgts.begin(); + std::vector<std::string> const& deptgts = y->second; + for(std::vector<std::string>::const_iterator d = deptgts.begin(); d != deptgts.end(); ++d) { makefileStream << this->PostBuildMakeTarget(*d, *ct) << ": " @@ -3553,12 +3542,12 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( makefileStream << trel << ":"; // List dependencies if any exist. - std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator + std::map<std::string, cmXCodeObject::StringVec>::const_iterator x = target->GetDependLibraries().find(*ct); if(x != target->GetDependLibraries().end()) { - std::vector<cmStdString> const& deplibs = x->second; - for(std::vector<cmStdString>::const_iterator d = deplibs.begin(); + std::vector<std::string> const& deplibs = x->second; + for(std::vector<std::string>::const_iterator d = deplibs.begin(); d != deplibs.end(); ++d) { makefileStream << "\\\n\t" << @@ -3783,14 +3772,14 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p) //---------------------------------------------------------------------------- void cmGlobalXCodeGenerator -::AppendDirectoryForConfig(const char* prefix, - const char* config, - const char* suffix, +::AppendDirectoryForConfig(const std::string& prefix, + const std::string& config, + const std::string& suffix, std::string& dir) { if(this->XcodeVersion > 20) { - if(config) + if(!config.empty()) { dir += prefix; dir += config; @@ -3800,12 +3789,13 @@ cmGlobalXCodeGenerator } //---------------------------------------------------------------------------- -std::string cmGlobalXCodeGenerator::LookupFlags(const char* varNamePrefix, - const char* varNameLang, - const char* varNameSuffix, - const char* default_flags) +std::string cmGlobalXCodeGenerator::LookupFlags( + const std::string& varNamePrefix, + const std::string& varNameLang, + const std::string& varNameSuffix, + const std::string& default_flags) { - if(varNameLang) + if(!varNameLang.empty()) { std::string varName = varNamePrefix; varName += varNameLang; @@ -3966,7 +3956,7 @@ cmGlobalXCodeGenerator // names since Xcode names them uniquely automatically with a numeric suffix // to avoid exact duplicate file names. Note that Mac file names are not // typically case sensitive, hence the LowerCase. - std::map<cmStdString, int> counts; + std::map<std::string, int> counts; std::vector<cmSourceFile*> objectSources; gt->GetObjectSources(objectSources); for(std::vector<cmSourceFile*>::const_iterator |