Refactor: reduce cmToCStr usage

This commit is contained in:
Marc Chevrier
2021-08-13 15:57:23 +02:00
parent 2984df9100
commit 5a2a275bb4
17 changed files with 62 additions and 69 deletions
+3 -4
View File
@@ -293,8 +293,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
this->GetConfigName());
for (cmSourceFile const* sf : externalObjects) {
auto const& objectFileName = sf->GetFullPath();
if (!cmSystemTools::StringEndsWith(objectFileName,
cmToCStr(pchExtension))) {
if (!cmHasSuffix(objectFileName, pchExtension)) {
this->ExternalObjects.push_back(objectFileName);
}
}
@@ -1732,7 +1731,7 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
cmProp pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION");
for (std::string const& obj : this->Objects) {
if (cmSystemTools::StringEndsWith(obj, cmToCStr(pchExtension))) {
if (cmHasSuffix(obj, pchExtension)) {
continue;
}
*this->BuildFileStream << " " << lineContinue;
@@ -1822,7 +1821,7 @@ void cmMakefileTargetGenerator::WriteObjectsStrings(
objStrings, this->LocalGenerator,
this->LocalGenerator->GetStateSnapshot().GetDirectory(), limit);
for (std::string const& obj : this->Objects) {
if (cmSystemTools::StringEndsWith(obj, cmToCStr(pchExtension))) {
if (cmHasSuffix(obj, pchExtension)) {
continue;
}
helper.Feed(obj);