mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 05:26:58 +08:00
GHS: Use cm::erase in place of loop
This commit is contained in:

committed by
Brad King

parent
efa30023b4
commit
db17de2438
@@ -9,6 +9,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <cm/memory>
|
#include <cm/memory>
|
||||||
|
#include <cm/string>
|
||||||
|
|
||||||
#include "cmAlgorithms.h"
|
#include "cmAlgorithms.h"
|
||||||
#include "cmDocumentationEntry.h"
|
#include "cmDocumentationEntry.h"
|
||||||
@@ -651,21 +652,16 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives(
|
|||||||
char const* const customization =
|
char const* const customization =
|
||||||
this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
|
this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
|
||||||
if (nullptr != customization && strlen(customization) > 0) {
|
if (nullptr != customization && strlen(customization) > 0) {
|
||||||
fout << "customization=" << this->TrimQuotes(customization) << std::endl;
|
fout << "customization="
|
||||||
|
<< cmGlobalGhsMultiGenerator::TrimQuotes(customization) << std::endl;
|
||||||
this->GetCMakeInstance()->MarkCliAsUsed("GHS_CUSTOMIZATION");
|
this->GetCMakeInstance()->MarkCliAsUsed("GHS_CUSTOMIZATION");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGlobalGhsMultiGenerator::TrimQuotes(std::string const& str)
|
std::string cmGlobalGhsMultiGenerator::TrimQuotes(std::string str)
|
||||||
{
|
{
|
||||||
std::string result;
|
cm::erase(str, '"');
|
||||||
result.reserve(str.size());
|
return str;
|
||||||
for (const char* ch = str.c_str(); *ch != '\0'; ++ch) {
|
|
||||||
if (*ch != '"') {
|
|
||||||
result += *ch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmGlobalGhsMultiGenerator::TargetCompare::operator()(
|
bool cmGlobalGhsMultiGenerator::TargetCompare::operator()(
|
||||||
|
@@ -111,7 +111,7 @@ private:
|
|||||||
std::vector<cmLocalGenerator*>& generators,
|
std::vector<cmLocalGenerator*>& generators,
|
||||||
std::string& all_target);
|
std::string& all_target);
|
||||||
|
|
||||||
std::string TrimQuotes(std::string const& str);
|
static std::string TrimQuotes(std::string str);
|
||||||
|
|
||||||
std::string OsDir;
|
std::string OsDir;
|
||||||
static const char* DEFAULT_BUILD_PROGRAM;
|
static const char* DEFAULT_BUILD_PROGRAM;
|
||||||
|
Reference in New Issue
Block a user