summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx67
1 files changed, 37 insertions, 30 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index ff76762..c375d60 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -70,14 +70,13 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
: cmGlobalVisualStudioGenerator(cm, platformInGeneratorName)
{
this->DevEnvCommandInitialized = false;
+ this->MarmasmEnabled = false;
this->MasmEnabled = false;
this->NasmEnabled = false;
this->ExtraFlagTable = cmVS7ExtraFlagTable;
}
-cmGlobalVisualStudio7Generator::~cmGlobalVisualStudio7Generator()
-{
-}
+cmGlobalVisualStudio7Generator::~cmGlobalVisualStudio7Generator() = default;
// Package GUID of Intel Visual Fortran plugin to VS IDE
#define CM_INTEL_PLUGIN_GUID "{B68A201D-CB9B-47AF-A52F-7EEC72E217E4}"
@@ -159,7 +158,7 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand()
// Search in standard location.
vskey = this->GetRegistryBase() + ";InstallDir";
- if (cmSystemTools::ReadRegistryValue(vskey.c_str(), vscmd,
+ if (cmSystemTools::ReadRegistryValue(vskey, vscmd,
cmSystemTools::KeyWOW64_32)) {
cmSystemTools::ConvertToUnixSlashes(vscmd);
vscmd += "/devenv.com";
@@ -170,9 +169,9 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand()
// Search where VS15Preview places it.
vskey = cmStrCat(
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;",
+ R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7;)",
this->GetIDEVersion());
- if (cmSystemTools::ReadRegistryValue(vskey.c_str(), vscmd,
+ if (cmSystemTools::ReadRegistryValue(vskey, vscmd,
cmSystemTools::KeyWOW64_32)) {
cmSystemTools::ConvertToUnixSlashes(vscmd);
vscmd += "/Common7/IDE/devenv.com";
@@ -191,17 +190,23 @@ const char* cmGlobalVisualStudio7Generator::ExternalProjectType(
std::string extension = cmSystemTools::GetFilenameLastExtension(location);
if (extension == ".vbproj") {
return "F184B08F-C81C-45F6-A57F-5ABD9991F28F";
- } else if (extension == ".csproj") {
+ }
+ if (extension == ".csproj") {
return "FAE04EC0-301F-11D3-BF4B-00C04F79EFBC";
- } else if (extension == ".fsproj") {
+ }
+ if (extension == ".fsproj") {
return "F2A71F9B-5D33-465A-A702-920D77279786";
- } else if (extension == ".vdproj") {
+ }
+ if (extension == ".vdproj") {
return "54435603-DBB4-11D2-8724-00A0C9A8B90C";
- } else if (extension == ".dbproj") {
+ }
+ if (extension == ".dbproj") {
return "C8D11400-126E-41CD-887F-60BD40844F9E";
- } else if (extension == ".wixproj") {
+ }
+ if (extension == ".wixproj") {
return "930C7802-8A8C-48F9-8165-68863BCCD9DD";
- } else if (extension == ".pyproj") {
+ }
+ if (extension == ".pyproj") {
return "888888A0-9F3D-457C-B088-3A5042F75D52";
}
return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942";
@@ -333,7 +338,7 @@ void cmGlobalVisualStudio7Generator::OutputSLNFile(
}
this->CurrentProject = root->GetProjectName();
std::string fname = GetSLNFile(root);
- cmGeneratedFileStream fout(fname.c_str());
+ cmGeneratedFileStream fout(fname);
fout.SetCopyIfDifferent(true);
if (!fout) {
return;
@@ -379,7 +384,8 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
// On VS 19 and above, always map .NET SDK projects to "Any CPU".
if (target->IsDotNetSdkTarget() &&
this->GetVersion() >= VSVersion::VS16 &&
- !this->IsReservedTarget(target->GetName())) {
+ !cmGlobalVisualStudio7Generator::IsReservedTarget(
+ target->GetName())) {
mapping = "Any CPU";
}
this->WriteProjectConfigurations(fout, *vcprojName, *target, configs,
@@ -420,7 +426,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
cmValue expath = target->GetProperty("EXTERNAL_MSPROJECT");
if (expath) {
std::string project = target->GetName();
- std::string location = *expath;
+ std::string const& location = *expath;
this->WriteExternalProject(fout, project, location,
target->GetProperty("VS_PROJECT_TYPE"),
@@ -451,7 +457,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
std::string cumulativePath;
for (std::string const& iter : tokens) {
- if (!iter.size()) {
+ if (iter.empty()) {
continue;
}
@@ -500,7 +506,7 @@ void cmGlobalVisualStudio7Generator::WriteFoldersContent(std::ostream& fout)
std::string guidParent(this->GetGUID(key));
for (std::string const& it : iter.second) {
- std::string value(it);
+ std::string const& value(it);
std::string guid(this->GetGUID(value));
fout << "\t\t{" << guid << "} = {" << guidParent << "}\n";
@@ -516,7 +522,7 @@ std::string cmGlobalVisualStudio7Generator::ConvertToSolutionPath(
// use windows slashes.
std::string d = path;
std::string::size_type pos = 0;
- while ((pos = d.find('/', pos)) != d.npos) {
+ while ((pos = d.find('/', pos)) != std::string::npos) {
d[pos++] = '\\';
}
return d;
@@ -540,8 +546,9 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
} else if (cmHasLiteralPrefix(name, "POST_")) {
name = name.substr(5);
sectionType = "postSolution";
- } else
+ } else {
continue;
+ }
if (!name.empty()) {
bool addGuid = false;
if (name == "ExtensibilityGlobals" && sectionType == "postSolution") {
@@ -579,9 +586,10 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
<< "\t\tSolutionGuid = {" << guid << "}\n"
<< "\tEndGlobalSection\n";
}
- if (!extensibilityAddInsOverridden)
+ if (!extensibilityAddInsOverridden) {
fout << "\tGlobalSection(ExtensibilityAddIns) = postSolution\n"
<< "\tEndGlobalSection\n";
+ }
}
// Standard end of dsw file
@@ -600,13 +608,13 @@ std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend(
std::string fname =
cmStrCat(target->GetLocalGenerator()->GetCurrentBinaryDirectory(), '/',
pname, ".vcproj");
- cmGeneratedFileStream fout(fname.c_str());
+ cmGeneratedFileStream fout(fname);
fout.SetCopyIfDifferent(true);
- std::string guid = this->GetGUID(pname.c_str());
+ std::string guid = this->GetGUID(pname);
/* clang-format off */
fout <<
- "<?xml version=\"1.0\" encoding = \""
+ R"(<?xml version="1.0" encoding = ")"
<< this->Encoding() << "\"?>\n"
"<VisualStudioProject\n"
"\tProjectType=\"Visual C++\"\n"
@@ -729,13 +737,12 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
bool cmGlobalVisualStudio7Generator::IsDependedOn(
OrderedTargetDependSet const& projectTargets, cmGeneratorTarget const* gtIn)
{
- for (cmTargetDepend const& l : projectTargets) {
- TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(l);
- if (tgtdeps.count(gtIn)) {
- return true;
- }
- }
- return false;
+ return std::any_of(projectTargets.begin(), projectTargets.end(),
+ [this, gtIn](cmTargetDepend const& l) {
+ TargetDependSet const& tgtdeps =
+ this->GetTargetDirectDepends(l);
+ return tgtdeps.count(gtIn);
+ });
}
std::string cmGlobalVisualStudio7Generator::Encoding()