diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2022-11-22 19:42:31 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2022-11-29 17:39:45 (GMT) |
commit | 362d6cd234dd8e83577bb72dcbe22949aa9253bf (patch) | |
tree | 0e1e97296748e6c755513e342e6937fe719cceee /Source | |
parent | d64adb9267213c0031b376633b70707ddcfc9ba6 (diff) | |
download | CMake-362d6cd234dd8e83577bb72dcbe22949aa9253bf.zip CMake-362d6cd234dd8e83577bb72dcbe22949aa9253bf.tar.gz CMake-362d6cd234dd8e83577bb72dcbe22949aa9253bf.tar.bz2 |
clang-tidy: fix `modernize-raw-string-literal` lints
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio9Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 12 |
9 files changed, 20 insertions, 20 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 6154d8e..192663d 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -774,7 +774,7 @@ std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand() // Search in standard location. mskey = cmStrCat( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\", + R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\)", this->GetToolsVersion(), ";MSBuildToolsPath"); if (cmSystemTools::ReadRegistryValue(mskey, msbuild, cmSystemTools::KeyWOW64_32)) { diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 3e84765..06fd61c 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -101,14 +101,14 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, // check to see if this is a fortran build std::string ext = ".vcproj"; const char* project = - "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""; + R"(Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = ")"; if (this->TargetIsFortranOnly(t)) { ext = ".vfproj"; - project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \""; + project = R"(Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = ")"; } if (t->IsCSharpOnly()) { ext = ".csproj"; - project = "Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \""; + project = R"(Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = ")"; } cmValue targetExt = t->GetProperty("GENERATOR_FILE_NAME_EXT"); if (targetExt) { @@ -129,7 +129,7 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, if (ui != this->UtilityDepends.end()) { const char* uname = ui->second.c_str(); /* clang-format off */ - fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" + fout << R"(Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = ")" << uname << "\", \"" << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"") << uname << ".vcproj" << "\", \"{" diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index d6eceb1..a6e8240 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -169,7 +169,7 @@ 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, vscmd, cmSystemTools::KeyWOW64_32)) { @@ -614,7 +614,7 @@ std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend( /* clang-format off */ fout << - "<?xml version=\"1.0\" encoding = \"" + R"(<?xml version="1.0" encoding = ")" << this->Encoding() << "\"?>\n" "<VisualStudioProject\n" "\tProjectType=\"Visual C++\"\n" diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 2f25217..70cb72a 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -53,7 +53,7 @@ std::string cmGlobalVisualStudio8Generator::FindDevEnvCommand() // First look for VCExpress. std::string vsxcmd; std::string vsxkey = - cmStrCat("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\", + cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\)", this->GetIDEVersion(), ";InstallDir"); if (cmSystemTools::ReadRegistryValue(vsxkey, vsxcmd, cmSystemTools::KeyWOW64_32)) { diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index cd0b114..9f6550b 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -158,5 +158,5 @@ std::string cmGlobalVisualStudio9Generator::GetUserMacrosDirectory() std::string cmGlobalVisualStudio9Generator::GetUserMacrosRegKeyBase() { - return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros"; + return R"(Software\Microsoft\VisualStudio\9.0\vsmacros)"; } diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index dd4b2a7..31f6f77 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -186,7 +186,7 @@ std::string cmGlobalVisualStudioGenerator::GetRegistryBase() std::string cmGlobalVisualStudioGenerator::GetRegistryBase(const char* version) { - std::string key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\"; + std::string key = R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\)"; return key + version; } diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 256ca1e..8dd7545 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -65,7 +65,7 @@ static bool VSHasDotNETFrameworkArm64() { std::string dotNetArm64; return cmSystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework;InstallRootArm64", + R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework;InstallRootArm64)", dotNetArm64, cmSystemTools::KeyWOW64_64); } @@ -530,7 +530,7 @@ bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance( if (!this->GeneratorInstanceVersion.empty()) { std::string const majorStr = VSVersionToMajorString(this->Version); cmsys::RegularExpression versionRegex( - cmStrCat("^", majorStr, "\\.[0-9]+\\.[0-9]+\\.[0-9]+$")); + cmStrCat("^", majorStr, R"(\.[0-9]+\.[0-9]+\.[0-9]+$)")); if (!versionRegex.find(this->GeneratorInstanceVersion)) { std::ostringstream e; /* clang-format off */ diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 28e8854..e1587f8 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1980,7 +1980,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStartFortran( cmGlobalVisualStudio7Generator* gg = static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); /* clang-format off */ - fout << "<?xml version=\"1.0\" encoding = \"" + fout << R"(<?xml version="1.0" encoding = ")" << gg->Encoding() << "\"?>\n" << "<VisualStudioProject\n" << "\tProjectCreator=\"Intel Fortran\"\n" @@ -2042,7 +2042,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStart( static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); /* clang-format off */ - fout << "<?xml version=\"1.0\" encoding = \"" + fout << R"(<?xml version="1.0" encoding = ")" << gg->Encoding() << "\"?>\n" << "<VisualStudioProject\n" << "\tProjectType=\"Visual C++\"\n"; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 147484b..d91723f 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -454,7 +454,7 @@ void cmVisualStudio10TargetGenerator::Generate() void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile( cmGeneratedFileStream& BuildFileStream) { - BuildFileStream << "<?xml version=\"1.0\" encoding=\"" + BuildFileStream << R"(<?xml version="1.0" encoding=")" << this->GlobalGenerator->Encoding() << "\"?>"; { Elem e0(BuildFileStream, "Project"); @@ -726,7 +726,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile( : customDir + this->GlobalGenerator ->GetPlatformToolsetCudaVSIntegrationSubdirString() + - "extras\\visual_studio_integration\\MSBuildExtensions\\"; + R"(extras\visual_studio_integration\MSBuildExtensions\)"; Elem(e1, "Import") .Attribute("Project", std::move(cudaPath) + "CUDA " + @@ -829,7 +829,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile( : customDir + this->GlobalGenerator ->GetPlatformToolsetCudaVSIntegrationSubdirString() + - "extras\\visual_studio_integration\\MSBuildExtensions\\"; + R"(extras\visual_studio_integration\MSBuildExtensions\)"; Elem(e1, "Import") .Attribute("Project", std::move(cudaPath) + "CUDA " + @@ -1925,7 +1925,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups() char magic[] = { char(0xEF), char(0xBB), char(0xBF) }; fout.write(magic, 3); - fout << "<?xml version=\"1.0\" encoding=\"" + fout << R"(<?xml version="1.0" encoding=")" << this->GlobalGenerator->Encoding() << "\"?>"; { Elem e0(fout, "Project"); @@ -2905,7 +2905,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions( if (ttype >= cmStateEnums::UTILITY) { e1.WritePlatformConfigTag( - "IntDir", cond, "$(Platform)\\$(Configuration)\\$(ProjectName)\\"); + "IntDir", cond, R"($(Platform)\$(Configuration)\$(ProjectName)\)"); } else { std::string intermediateDir = cmStrCat( this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget), '/', @@ -3594,7 +3594,7 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions( // limitation by creating the directory and passing the flag ourselves. pdb = this->ConvertPath(pdb, true); ConvertToWindowsSlash(pdb); - std::string const clFd = "-Xcompiler=\"-Fd\\\"" + pdb + "\\\"\""; + std::string const clFd = R"(-Xcompiler="-Fd\")" + pdb + R"(\"")"; cudaOptions.AppendFlagString("AdditionalOptions", clFd); } } |