diff options
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r-- | Source/cmCommonTargetGenerator.cxx | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 66250f329..19a096bdf 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -6,7 +6,6 @@ #include <sstream> #include <utility> -#include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmGeneratorTarget.h" #include "cmGlobalCommonGenerator.h" @@ -17,6 +16,7 @@ #include "cmOutputConverter.h" #include "cmSourceFile.h" #include "cmStateTypes.h" +#include "cmStringAlgorithms.h" cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt) : GeneratorTarget(gt) @@ -59,10 +59,11 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag( // Append the flag and value. Use ConvertToLinkReference to help // vs6's "cl -link" pass it to the linker. - std::string flag = defFileFlag; - flag += this->LocalCommonGenerator->ConvertToOutputFormat( - linkLineComputer->ConvertToLinkReference(mdi->DefFile), - cmOutputConverter::SHELL); + std::string flag = + cmStrCat(defFileFlag, + this->LocalCommonGenerator->ConvertToOutputFormat( + linkLineComputer->ConvertToLinkReference(mdi->DefFile), + cmOutputConverter::SHELL)); this->LocalCommonGenerator->AppendFlags(flags, flag); } @@ -89,13 +90,13 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags( } if (var) { this->LocalCommonGenerator->AppendFlags( - flags, this->Makefile->GetDefinition(var)); + flags, this->Makefile->GetSafeDefinition(var)); } } std::string cmCommonTargetGenerator::GetFlags(const std::string& l) { - ByLanguageMap::iterator i = this->FlagsByLanguage.find(l); + auto i = this->FlagsByLanguage.find(l); if (i == this->FlagsByLanguage.end()) { std::string flags; @@ -110,7 +111,7 @@ std::string cmCommonTargetGenerator::GetFlags(const std::string& l) std::string cmCommonTargetGenerator::GetDefines(const std::string& l) { - ByLanguageMap::iterator i = this->DefinesByLanguage.find(l); + auto i = this->DefinesByLanguage.find(l); if (i == this->DefinesByLanguage.end()) { std::set<std::string> defines; this->LocalCommonGenerator->GetTargetDefines(this->GeneratorTarget, @@ -127,7 +128,7 @@ std::string cmCommonTargetGenerator::GetDefines(const std::string& l) std::string cmCommonTargetGenerator::GetIncludes(std::string const& l) { - ByLanguageMap::iterator i = this->IncludesByLanguage.find(l); + auto i = this->IncludesByLanguage.find(l); if (i == this->IncludesByLanguage.end()) { std::string includes; this->AddIncludeFlags(includes, l); @@ -155,9 +156,8 @@ std::vector<std::string> cmCommonTargetGenerator::GetLinkedTargetDirectories() && linkee->GetType() != cmStateEnums::INTERFACE_LIBRARY && emitted.insert(linkee).second) { cmLocalGenerator* lg = linkee->GetLocalGenerator(); - std::string di = lg->GetCurrentBinaryDirectory(); - di += "/"; - di += lg->GetTargetDirectory(linkee); + std::string di = cmStrCat(lg->GetCurrentBinaryDirectory(), '/', + lg->GetTargetDirectory(linkee)); dirs.push_back(std::move(di)); } } @@ -171,6 +171,7 @@ std::string cmCommonTargetGenerator::ComputeTargetCompilePDB() const if (this->GeneratorTarget->GetType() > cmStateEnums::OBJECT_LIBRARY) { return compilePdbPath; } + compilePdbPath = this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName()); if (compilePdbPath.empty()) { @@ -210,11 +211,7 @@ void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags, const char* name, bool so) { // Lookup the flag to specify the version. - std::string fvar = "CMAKE_"; - fvar += lang; - fvar += "_OSX_"; - fvar += name; - fvar += "_VERSION_FLAG"; + std::string fvar = cmStrCat("CMAKE_", lang, "_OSX_", name, "_VERSION_FLAG"); const char* flag = this->Makefile->GetDefinition(fvar); // Skip if no such flag. |