|
|
@@ -26,7 +26,6 @@
|
|
|
#include "cmGeneratedFileStream.h"
|
|
|
#include "cmGeneratorExpression.h"
|
|
|
#include "cmGeneratorTarget.h"
|
|
|
-#include "cmGlobalCommonGenerator.h"
|
|
|
#include "cmGlobalUnixMakefileGenerator3.h"
|
|
|
#include "cmLinkLineComputer.h" // IWYU pragma: keep
|
|
|
#include "cmList.h"
|
|
|
@@ -420,7 +419,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
|
|
|
this->GeneratorTarget->HasLinkDependencyFile(this->GetConfigName());
|
|
|
|
|
|
if (compilerGenerateDeps || linkerGenerateDeps || ccGenerateDeps) {
|
|
|
- std::string compilerDependFile =
|
|
|
+ std::string const compilerDependFile =
|
|
|
cmStrCat(this->TargetBuildDirectoryFull, "/compiler_depend.make");
|
|
|
*this->BuildFileStream << "# Include any dependencies generated by the "
|
|
|
"compiler for this target.\n"
|
|
|
@@ -613,17 +612,17 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
}
|
|
|
|
|
|
// Use compiler to generate dependencies, if supported.
|
|
|
- bool compilerGenerateDeps =
|
|
|
+ bool const compilerGenerateDeps =
|
|
|
this->GlobalGenerator->SupportsCompilerDependencies() &&
|
|
|
cmIsOn(this->Makefile->GetDefinition(
|
|
|
cmStrCat("CMAKE_", lang, "_DEPENDS_USE_COMPILER")));
|
|
|
- auto scanner = compilerGenerateDeps ? cmDependencyScannerKind::Compiler
|
|
|
- : cmDependencyScannerKind::CMake;
|
|
|
+ auto const scanner = compilerGenerateDeps ? cmDependencyScannerKind::Compiler
|
|
|
+ : cmDependencyScannerKind::CMake;
|
|
|
|
|
|
// Get the full path name of the object file.
|
|
|
std::string const& objectName =
|
|
|
this->GeneratorTarget->GetObjectName(&source);
|
|
|
- std::string obj =
|
|
|
+ std::string const obj =
|
|
|
cmStrCat(this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
|
|
|
'/', objectName);
|
|
|
|
|
|
@@ -642,7 +641,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
// Create the directory containing the object file. This may be a
|
|
|
// subdirectory under the target's directory.
|
|
|
{
|
|
|
- std::string dir = cmSystemTools::GetFilenamePath(obj);
|
|
|
+ std::string const dir = cmSystemTools::GetFilenamePath(obj);
|
|
|
cmSystemTools::MakeDirectory(this->LocalGenerator->ConvertToFullPath(dir));
|
|
|
}
|
|
|
|
|
|
@@ -656,7 +655,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
std::string objFullPath =
|
|
|
cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), '/', obj);
|
|
|
objFullPath = cmSystemTools::CollapseFullPath(objFullPath);
|
|
|
- std::string srcFullPath =
|
|
|
+ std::string const srcFullPath =
|
|
|
cmSystemTools::CollapseFullPath(source.GetFullPath());
|
|
|
this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, lang,
|
|
|
objFullPath, srcFullPath, scanner);
|
|
|
@@ -669,8 +668,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
// generate the depend scanning rule
|
|
|
this->WriteObjectDependRules(source, depends);
|
|
|
|
|
|
- std::string config = this->GetConfigName();
|
|
|
- std::string configUpper = cmSystemTools::UpperCase(config);
|
|
|
+ std::string const config = this->GetConfigName();
|
|
|
+ std::string const configUpper = cmSystemTools::UpperCase(config);
|
|
|
|
|
|
// Add precompile headers dependencies
|
|
|
std::vector<std::string> architectures =
|
|
|
@@ -726,7 +725,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
this->GeneratorTarget->AddExplicitLanguageFlags(flags, source);
|
|
|
|
|
|
// Add language-specific flags.
|
|
|
- std::string langFlags = cmStrCat("$(", lang, "_FLAGS", filterArch, ")");
|
|
|
+ std::string const langFlags =
|
|
|
+ cmStrCat("$(", lang, "_FLAGS", filterArch, ")");
|
|
|
this->LocalGenerator->AppendFlags(flags, langFlags);
|
|
|
|
|
|
cmGeneratorExpressionInterpreter genexInterpreter(
|
|
|
@@ -745,7 +745,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
cmSystemTools::GetFilenameWithoutLastExtension(objectName);
|
|
|
ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(ispcSource);
|
|
|
|
|
|
- cmValue ispcSuffixProp =
|
|
|
+ cmValue const ispcSuffixProp =
|
|
|
this->GeneratorTarget->GetProperty("ISPC_HEADER_SUFFIX");
|
|
|
assert(ispcSuffixProp);
|
|
|
|
|
|
@@ -784,7 +784,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
// Add precompile headers compile options.
|
|
|
if (!pchSources.empty() && !source.GetProperty("SKIP_PRECOMPILE_HEADERS")) {
|
|
|
std::string pchOptions;
|
|
|
- auto pchIt = pchSources.find(source.GetFullPath());
|
|
|
+ auto const pchIt = pchSources.find(source.GetFullPath());
|
|
|
if (pchIt != pchSources.end()) {
|
|
|
pchOptions = this->GeneratorTarget->GetPchCreateCompileOptions(
|
|
|
config, lang, pchIt->second);
|
|
|
@@ -830,7 +830,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
<< "_DEFINES = " << evaluatedDefs << "\n"
|
|
|
<< "\n";
|
|
|
}
|
|
|
- std::string defPropName = cmStrCat("COMPILE_DEFINITIONS_", configUpper);
|
|
|
+ std::string const defPropName =
|
|
|
+ cmStrCat("COMPILE_DEFINITIONS_", configUpper);
|
|
|
if (cmValue config_compile_defs = source.GetProperty(defPropName)) {
|
|
|
const std::string& evaluatedDefs =
|
|
|
genexInterpreter.Evaluate(*config_compile_defs, COMPILE_DEFINITIONS);
|
|
|
@@ -841,7 +842,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
}
|
|
|
|
|
|
// Get the output paths for source and object files.
|
|
|
- std::string sourceFile = this->LocalGenerator->ConvertToOutputFormat(
|
|
|
+ std::string const sourceFile = this->LocalGenerator->ConvertToOutputFormat(
|
|
|
source.GetFullPath(), cmOutputConverter::SHELL);
|
|
|
|
|
|
// Construct the build message.
|
|
|
@@ -897,7 +898,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
targetOutPathCompilePDB.back() = '/';
|
|
|
}
|
|
|
|
|
|
- std::string compilePdbOutputPath =
|
|
|
+ std::string const compilePdbOutputPath =
|
|
|
this->GeneratorTarget->GetCompilePDBDirectory(this->GetConfigName());
|
|
|
cmSystemTools::MakeDirectory(compilePdbOutputPath);
|
|
|
}
|
|
|
@@ -910,7 +911,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
vars.TargetPDB = targetOutPathPDB.c_str();
|
|
|
vars.TargetCompilePDB = targetOutPathCompilePDB.c_str();
|
|
|
vars.Source = sourceFile.c_str();
|
|
|
- std::string shellObj =
|
|
|
+ std::string const shellObj =
|
|
|
this->LocalGenerator->ConvertToOutputFormat(obj, cmOutputConverter::SHELL);
|
|
|
vars.Object = shellObj.c_str();
|
|
|
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
|
|
@@ -960,7 +961,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
// At the moment, it is assumed that C, C++, Fortran, and CUDA have both
|
|
|
// assembly and preprocessor capabilities. The same is true for the
|
|
|
// ability to export compile commands
|
|
|
- bool lang_has_preprocessor =
|
|
|
+ bool const lang_has_preprocessor =
|
|
|
((lang == "C") || (lang == "CXX") || (lang == "OBJC") ||
|
|
|
(lang == "OBJCXX") || (lang == "Fortran") || (lang == "CUDA") ||
|
|
|
lang == "ISPC" || lang == "HIP" || lang == "ASM");
|
|
|
@@ -1016,31 +1017,31 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
// no launcher for CMAKE_EXPORT_COMPILE_COMMANDS
|
|
|
rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
|
|
|
compileCommand, vars);
|
|
|
- std::string workingDirectory =
|
|
|
+ std::string const workingDirectory =
|
|
|
this->LocalGenerator->GetCurrentBinaryDirectory();
|
|
|
std::string::size_type lfPos = compileCommand.find(langFlags);
|
|
|
if (lfPos != std::string::npos) {
|
|
|
compileCommand.replace(lfPos, langFlags.size(),
|
|
|
this->GetFlags(lang, this->GetConfigName()));
|
|
|
}
|
|
|
- std::string langDefines = std::string("$(") + lang + "_DEFINES)";
|
|
|
- std::string::size_type ldPos = compileCommand.find(langDefines);
|
|
|
+ std::string const langDefines = std::string("$(") + lang + "_DEFINES)";
|
|
|
+ std::string::size_type const ldPos = compileCommand.find(langDefines);
|
|
|
if (ldPos != std::string::npos) {
|
|
|
compileCommand.replace(ldPos, langDefines.size(),
|
|
|
this->GetDefines(lang, this->GetConfigName()));
|
|
|
}
|
|
|
- std::string langIncludes = std::string("$(") + lang + "_INCLUDES)";
|
|
|
- std::string::size_type liPos = compileCommand.find(langIncludes);
|
|
|
+ std::string const langIncludes = std::string("$(") + lang + "_INCLUDES)";
|
|
|
+ std::string::size_type const liPos = compileCommand.find(langIncludes);
|
|
|
if (liPos != std::string::npos) {
|
|
|
compileCommand.replace(liPos, langIncludes.size(),
|
|
|
this->GetIncludes(lang, this->GetConfigName()));
|
|
|
}
|
|
|
|
|
|
- cmValue eliminate[] = {
|
|
|
+ cmValue const eliminate[] = {
|
|
|
this->Makefile->GetDefinition("CMAKE_START_TEMP_FILE"),
|
|
|
this->Makefile->GetDefinition("CMAKE_END_TEMP_FILE")
|
|
|
};
|
|
|
- for (cmValue el : eliminate) {
|
|
|
+ for (cmValue const& el : eliminate) {
|
|
|
if (el) {
|
|
|
cmSystemTools::ReplaceString(compileCommand, *el, "");
|
|
|
}
|
|
|
@@ -1052,150 +1053,16 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
|
|
|
// See if we need to use a compiler launcher like ccache or distcc
|
|
|
std::string compilerLauncher;
|
|
|
- if (!compileCommands.empty() &&
|
|
|
- (lang == "C" || lang == "CXX" || lang == "Fortran" || lang == "CUDA" ||
|
|
|
- lang == "HIP" || lang == "ISPC" || lang == "OBJC" ||
|
|
|
- lang == "OBJCXX")) {
|
|
|
- std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
|
|
|
- cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
|
|
|
- std::string evaluatedClauncher = cmGeneratorExpression::Evaluate(
|
|
|
- *clauncher, this->LocalGenerator, config, this->GeneratorTarget,
|
|
|
- nullptr, this->GeneratorTarget, lang);
|
|
|
- if (!evaluatedClauncher.empty()) {
|
|
|
- compilerLauncher = evaluatedClauncher;
|
|
|
- }
|
|
|
+ if (!compileCommands.empty()) {
|
|
|
+ compilerLauncher = GetCompilerLauncher(lang, config);
|
|
|
}
|
|
|
|
|
|
- // Maybe insert an include-what-you-use runner.
|
|
|
- if (!compileCommands.empty() &&
|
|
|
- (lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX")) {
|
|
|
- cmValue tidy = nullptr;
|
|
|
- cmValue iwyu = nullptr;
|
|
|
- cmValue cpplint = nullptr;
|
|
|
- cmValue cppcheck = nullptr;
|
|
|
- std::string evaluatedTIDY;
|
|
|
- std::string evaluatedIWYU;
|
|
|
- std::string evaluatedCPPlint;
|
|
|
- std::string evaluatedCPPcheck;
|
|
|
-
|
|
|
- std::string const tidy_prop = cmStrCat(lang, "_CLANG_TIDY");
|
|
|
- tidy = this->GeneratorTarget->GetProperty(tidy_prop);
|
|
|
- evaluatedTIDY = cmGeneratorExpression::Evaluate(
|
|
|
- *tidy, this->LocalGenerator, config, this->GeneratorTarget, nullptr,
|
|
|
- this->GeneratorTarget, lang);
|
|
|
- if (!evaluatedTIDY.empty()) {
|
|
|
- tidy = cmValue(&evaluatedTIDY);
|
|
|
- }
|
|
|
-
|
|
|
- if (lang == "C" || lang == "CXX") {
|
|
|
- std::string const iwyu_prop = cmStrCat(lang, "_INCLUDE_WHAT_YOU_USE");
|
|
|
- iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
|
|
|
- evaluatedIWYU = cmGeneratorExpression::Evaluate(
|
|
|
- *iwyu, this->LocalGenerator, config, this->GeneratorTarget, nullptr,
|
|
|
- this->GeneratorTarget, lang);
|
|
|
- if (!evaluatedIWYU.empty()) {
|
|
|
- iwyu = cmValue(&evaluatedIWYU);
|
|
|
- }
|
|
|
-
|
|
|
- std::string const cpplint_prop = cmStrCat(lang, "_CPPLINT");
|
|
|
- cpplint = this->GeneratorTarget->GetProperty(cpplint_prop);
|
|
|
- evaluatedCPPlint = cmGeneratorExpression::Evaluate(
|
|
|
- *cpplint, this->LocalGenerator, config, this->GeneratorTarget,
|
|
|
- nullptr, this->GeneratorTarget, lang);
|
|
|
- if (!evaluatedCPPlint.empty()) {
|
|
|
- cpplint = cmValue(&evaluatedCPPlint);
|
|
|
- }
|
|
|
-
|
|
|
- std::string const cppcheck_prop = cmStrCat(lang, "_CPPCHECK");
|
|
|
- cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop);
|
|
|
- evaluatedCPPcheck = cmGeneratorExpression::Evaluate(
|
|
|
- *cppcheck, this->LocalGenerator, config, this->GeneratorTarget,
|
|
|
- nullptr, this->GeneratorTarget, lang);
|
|
|
- if (!evaluatedCPPcheck.empty()) {
|
|
|
- cppcheck = cmValue(&evaluatedCPPcheck);
|
|
|
- }
|
|
|
- }
|
|
|
- if (cmNonempty(iwyu) || cmNonempty(tidy) || cmNonempty(cpplint) ||
|
|
|
- cmNonempty(cppcheck)) {
|
|
|
- std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_co_compile";
|
|
|
- if (!compilerLauncher.empty()) {
|
|
|
- // In __run_co_compile case the launcher command is supplied
|
|
|
- // via --launcher=<maybe-list> and consumed
|
|
|
- run_iwyu += " --launcher=";
|
|
|
- run_iwyu += this->LocalGenerator->EscapeForShell(compilerLauncher);
|
|
|
- compilerLauncher.clear();
|
|
|
- }
|
|
|
- if (cmNonempty(iwyu)) {
|
|
|
- run_iwyu += " --iwyu=";
|
|
|
-
|
|
|
- // Only add --driver-mode if it is not already specified, as adding
|
|
|
- // it unconditionally might override a user-specified driver-mode
|
|
|
- if (iwyu.Get()->find("--driver-mode=") == std::string::npos) {
|
|
|
- cmValue p = this->Makefile->GetDefinition(
|
|
|
- cmStrCat("CMAKE_", lang, "_INCLUDE_WHAT_YOU_USE_DRIVER_MODE"));
|
|
|
- std::string driverMode;
|
|
|
-
|
|
|
- if (cmNonempty(p)) {
|
|
|
- driverMode = *p;
|
|
|
- } else {
|
|
|
- driverMode = lang == "C" ? "gcc" : "g++";
|
|
|
- }
|
|
|
-
|
|
|
- run_iwyu += this->LocalGenerator->EscapeForShell(
|
|
|
- cmStrCat(*iwyu, ";--driver-mode=", driverMode));
|
|
|
- } else {
|
|
|
- run_iwyu += this->LocalGenerator->EscapeForShell(*iwyu);
|
|
|
- }
|
|
|
- }
|
|
|
- if (cmNonempty(tidy)) {
|
|
|
- run_iwyu += " --tidy=";
|
|
|
- cmValue p = this->Makefile->GetDefinition("CMAKE_" + lang +
|
|
|
- "_CLANG_TIDY_DRIVER_MODE");
|
|
|
- std::string driverMode;
|
|
|
- if (cmNonempty(p)) {
|
|
|
- driverMode = *p;
|
|
|
- } else {
|
|
|
- driverMode = lang == "C" ? "gcc" : "g++";
|
|
|
- }
|
|
|
- std::string d =
|
|
|
- this->GeneratorTarget->GetClangTidyExportFixesDirectory(lang);
|
|
|
- std::string exportFixes;
|
|
|
- if (!d.empty()) {
|
|
|
- this->GlobalCommonGenerator->AddClangTidyExportFixesDir(d);
|
|
|
- std::string fixesFile = cmSystemTools::CollapseFullPath(cmStrCat(
|
|
|
- d, '/',
|
|
|
- this->LocalGenerator->MaybeRelativeToTopBinDir(cmStrCat(
|
|
|
- this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
|
|
|
- this->LocalGenerator->GetTargetDirectory(
|
|
|
- this->GeneratorTarget),
|
|
|
- '/', objectName, ".yaml"))));
|
|
|
- this->GlobalCommonGenerator->AddClangTidyExportFixesFile(
|
|
|
- fixesFile);
|
|
|
- cmSystemTools::MakeDirectory(
|
|
|
- cmSystemTools::GetFilenamePath(fixesFile));
|
|
|
- fixesFile =
|
|
|
- this->LocalGenerator->MaybeRelativeToCurBinDir(fixesFile);
|
|
|
- exportFixes = cmStrCat(";--export-fixes=", fixesFile);
|
|
|
- }
|
|
|
- run_iwyu += this->LocalGenerator->EscapeForShell(
|
|
|
- cmStrCat(*tidy, ";--extra-arg-before=--driver-mode=", driverMode,
|
|
|
- exportFixes));
|
|
|
- }
|
|
|
- if (cmNonempty(cpplint)) {
|
|
|
- run_iwyu += " --cpplint=";
|
|
|
- run_iwyu += this->LocalGenerator->EscapeForShell(*cpplint);
|
|
|
- }
|
|
|
- if (cmNonempty(cppcheck)) {
|
|
|
- run_iwyu += " --cppcheck=";
|
|
|
- run_iwyu += this->LocalGenerator->EscapeForShell(*cppcheck);
|
|
|
- }
|
|
|
- if (cmNonempty(tidy) || (cmNonempty(cpplint)) ||
|
|
|
- (cmNonempty(cppcheck))) {
|
|
|
- run_iwyu += " --source=";
|
|
|
- run_iwyu += sourceFile;
|
|
|
- }
|
|
|
- run_iwyu += " -- ";
|
|
|
- compileCommands.front().insert(0, run_iwyu);
|
|
|
+ cmValue const skipCodeCheck = source.GetProperty("SKIP_LINTING");
|
|
|
+ if (!skipCodeCheck.IsOn()) {
|
|
|
+ std::string const codeCheck = this->GenerateCodeCheckRules(
|
|
|
+ source, compilerLauncher, "$(CMAKE_COMMAND)", config, nullptr);
|
|
|
+ if (!codeCheck.empty()) {
|
|
|
+ compileCommands.front().insert(0, codeCheck);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1330,8 +1197,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
|
|
|
|
|
if (do_preprocess_rules) {
|
|
|
commands.clear();
|
|
|
- std::string relativeObjI = relativeObjBase + ".i";
|
|
|
- std::string objI = objBase + ".i";
|
|
|
+ std::string const relativeObjI = relativeObjBase + ".i";
|
|
|
+ std::string const objI = objBase + ".i";
|
|
|
|
|
|
std::string preprocessEcho =
|
|
|
cmStrCat("Preprocessing ", lang, " source to ", objI);
|
|
|
@@ -1423,7 +1290,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules()
|
|
|
std::vector<std::string> commands;
|
|
|
|
|
|
// Construct the clean target name.
|
|
|
- std::string cleanTarget = cmStrCat(
|
|
|
+ std::string const cleanTarget = cmStrCat(
|
|
|
this->LocalGenerator->GetRelativeTargetDirectory(this->GeneratorTarget),
|
|
|
"/clean");
|
|
|
|
|
|
@@ -1451,7 +1318,7 @@ bool cmMakefileTargetGenerator::WriteMakeRule(
|
|
|
}
|
|
|
|
|
|
// Check whether we need to bother checking for a symbolic output.
|
|
|
- bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
|
|
|
+ bool const need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
|
|
|
|
|
|
// Check whether the first output is marked as symbolic.
|
|
|
if (need_symbolic) {
|
|
|
@@ -1481,7 +1348,7 @@ bool cmMakefileTargetGenerator::WriteMakeRule(
|
|
|
|
|
|
bool o_symbolic = false;
|
|
|
if (need_symbolic) {
|
|
|
- if (cmSourceFile* sf = this->Makefile->GetSource(output)) {
|
|
|
+ if (cmSourceFile const* sf = this->Makefile->GetSource(output)) {
|
|
|
o_symbolic = sf->GetPropertyAsBool("SYMBOLIC");
|
|
|
}
|
|
|
}
|
|
|
@@ -1517,6 +1384,23 @@ void cmMakefileTargetGenerator::WriteTargetLinkDependRules()
|
|
|
this->GeneratorTarget->GetFullPath(this->GetConfigName()), depFile,
|
|
|
cmDependencyScannerKind::Compiler);
|
|
|
}
|
|
|
+std::string cmMakefileTargetGenerator::GetClangTidyReplacementsFilePath(
|
|
|
+ std::string const& directory, cmSourceFile const& source,
|
|
|
+ std::string const& config) const
|
|
|
+{
|
|
|
+ (void)config;
|
|
|
+ auto const& objectName = this->GeneratorTarget->GetObjectName(&source);
|
|
|
+ auto fixesFile = cmSystemTools::CollapseFullPath(cmStrCat(
|
|
|
+ directory, '/',
|
|
|
+ this->GeneratorTarget->GetLocalGenerator()->MaybeRelativeToTopBinDir(
|
|
|
+ cmStrCat(this->GeneratorTarget->GetLocalGenerator()
|
|
|
+ ->GetCurrentBinaryDirectory(),
|
|
|
+ '/',
|
|
|
+ this->GeneratorTarget->GetLocalGenerator()->GetTargetDirectory(
|
|
|
+ this->GeneratorTarget),
|
|
|
+ '/', objectName, ".yaml"))));
|
|
|
+ return fixesFile;
|
|
|
+}
|
|
|
|
|
|
void cmMakefileTargetGenerator::WriteTargetDependRules()
|
|
|
{
|
|
|
@@ -1559,7 +1443,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
|
|
|
"# Targets to which this target links which contain Fortran sources.\n"
|
|
|
"set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES\n";
|
|
|
/* clang-format on */
|
|
|
- std::vector<std::string> dirs =
|
|
|
+ std::vector<std::string> const dirs =
|
|
|
this->GetLinkedTargetDirectories("Fortran", this->GetConfigName());
|
|
|
for (std::string const& d : dirs) {
|
|
|
*this->InfoFileStream << " \"" << d << "/DependInfo.cmake\"\n";
|
|
|
@@ -1591,7 +1475,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
|
|
|
std::vector<std::string> commands;
|
|
|
|
|
|
// Construct the name of the dependency generation target.
|
|
|
- std::string depTarget = cmStrCat(
|
|
|
+ std::string const depTarget = cmStrCat(
|
|
|
this->LocalGenerator->GetRelativeTargetDirectory(this->GeneratorTarget),
|
|
|
"/depend");
|
|
|
|
|
|
@@ -1701,7 +1585,7 @@ void cmMakefileTargetGenerator::WriteDeviceLinkRule(
|
|
|
deps.emplace_back(cmStrCat(relPath, obj));
|
|
|
}
|
|
|
|
|
|
- std::unordered_set<std::string> depsSet(deps.begin(), deps.end());
|
|
|
+ std::unordered_set<std::string> const depsSet(deps.begin(), deps.end());
|
|
|
deps.clear();
|
|
|
std::copy(depsSet.begin(), depsSet.end(), std::back_inserter(deps));
|
|
|
return deps;
|
|
|
@@ -1785,7 +1669,7 @@ void cmMakefileTargetGenerator::WriteDeviceLinkRule(
|
|
|
this->GetDeviceLinkFlags(linkFlags, "CUDA");
|
|
|
vars.LinkFlags = linkFlags.c_str();
|
|
|
|
|
|
- std::string flags = this->GetFlags("CUDA", this->GetConfigName());
|
|
|
+ std::string const flags = this->GetFlags("CUDA", this->GetConfigName());
|
|
|
vars.Flags = flags.c_str();
|
|
|
|
|
|
std::string compileCmd = this->GetLinkRule("CMAKE_CUDA_DEVICE_LINK_COMPILE");
|
|
|
@@ -1839,8 +1723,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile(
|
|
|
|
|
|
// Write the rule.
|
|
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
|
|
- bool symbolic = this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs,
|
|
|
- depends, commands);
|
|
|
+ bool const symbolic = this->WriteMakeRule(*this->BuildFileStream, nullptr,
|
|
|
+ outputs, depends, commands);
|
|
|
|
|
|
// Symbolic inputs are not expected to exist, so add dummy rules.
|
|
|
if (this->CMP0113New && !depends.empty()) {
|
|
|
@@ -2328,7 +2212,7 @@ void cmMakefileTargetGenerator::CreateObjectLists(
|
|
|
useWatcomQuote);
|
|
|
if (useResponseFile) {
|
|
|
// MSVC response files cannot exceed 128K.
|
|
|
- std::string::size_type const responseFileLimit = 131000;
|
|
|
+ std::string::size_type constexpr responseFileLimit = 131000;
|
|
|
|
|
|
// Construct the individual object list strings.
|
|
|
std::vector<std::string> object_strings;
|
|
|
@@ -2461,7 +2345,8 @@ std::string cmMakefileTargetGenerator::GetResponseFlag(
|
|
|
std::string responseFlag = "@";
|
|
|
std::string responseFlagVar;
|
|
|
|
|
|
- auto lang = this->GeneratorTarget->GetLinkerLanguage(this->GetConfigName());
|
|
|
+ auto const lang =
|
|
|
+ this->GeneratorTarget->GetLinkerLanguage(this->GetConfigName());
|
|
|
if (mode == cmMakefileTargetGenerator::ResponseFlagFor::Link) {
|
|
|
responseFlagVar = cmStrCat("CMAKE_", lang, "_RESPONSE_FILE_LINK_FLAG");
|
|
|
} else if (mode == cmMakefileTargetGenerator::ResponseFlagFor::DeviceLink) {
|