summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorOleksandr Koval <oleksandr.koval.dev@gmail.com>2021-01-05 12:32:36 (GMT)
committerOleksandr Koval <oleksandr.koval.dev@gmail.com>2021-01-05 12:32:36 (GMT)
commit209daa20b2bd2ee2a76e70af58e895647f7e284f (patch)
tree081f3192927b19325f40c0da459a11e5b5a5784b /Source/cmNinjaNormalTargetGenerator.cxx
parent764ce15ffbe232347a41e40509a2e485bae226f6 (diff)
downloadCMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.zip
CMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.tar.gz
CMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.tar.bz2
Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx60
1 files changed, 31 insertions, 29 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index a5b9466..620b8ff 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -49,7 +49,7 @@ cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator(
// on Windows the output dir is already needed at compile time
// ensure the directory exists (OutDir test)
for (auto const& config : this->GetConfigNames()) {
- EnsureDirectoryExists(target->GetDirectory(config));
+ this->EnsureDirectoryExists(target->GetDirectory(config));
}
}
@@ -306,7 +306,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRules(
{
const cmMakefile* mf = this->GetMakefile();
- cmNinjaRule rule(LanguageLinkerCudaDeviceRule(config));
+ cmNinjaRule rule(this->LanguageLinkerCudaDeviceRule(config));
rule.Command = this->GetLocalGenerator()->BuildCommandLine(
{ cmStrCat(mf->GetRequiredDefinition("CMAKE_CUDA_DEVICE_LINKER"),
" -arch=$ARCH $REGISTER -o=$out $in") });
@@ -334,13 +334,13 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRules(
rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(),
compileCmd, vars);
- rule.Name = LanguageLinkerCudaDeviceCompileRule(config);
+ rule.Name = this->LanguageLinkerCudaDeviceCompileRule(config);
rule.Command = this->GetLocalGenerator()->BuildCommandLine({ compileCmd });
rule.Comment = "Rule for compiling CUDA device stubs.";
rule.Description = "Compiling CUDA device stub $out";
this->GetGlobalGenerator()->AddRule(rule);
- rule.Name = LanguageLinkerCudaFatbinaryRule(config);
+ rule.Name = this->LanguageLinkerCudaFatbinaryRule(config);
rule.Command = this->GetLocalGenerator()->BuildCommandLine(
{ cmStrCat(mf->GetRequiredDefinition("CMAKE_CUDA_FATBINARY"),
" -64 -cmdline=--compile-only -compress-all -link "
@@ -385,7 +385,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
// build response file name
std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG";
- cmProp flag = GetMakefile()->GetDefinition(cmakeLinkVar);
+ cmProp flag = this->GetMakefile()->GetDefinition(cmakeLinkVar);
if (flag) {
responseFlag = *flag;
@@ -673,7 +673,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement(
targetOutputDir = globalGen->ExpandCFGIntDir(targetOutputDir, config);
std::string targetOutputReal =
- ConvertToNinjaPath(targetOutputDir + "cmake_device_link" + objExt);
+ this->ConvertToNinjaPath(targetOutputDir + "cmake_device_link" + objExt);
if (firstForConfig) {
globalGen->GetByproductsForCleanTarget(config).push_back(targetOutputReal);
@@ -730,7 +730,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements(
this->GetGlobalGenerator()->ConfigDirectory(config));
const std::string ninjaOutputDir = this->ConvertToNinjaPath(objectDir);
- cmNinjaBuild fatbinary(LanguageLinkerCudaFatbinaryRule(config));
+ cmNinjaBuild fatbinary(this->LanguageLinkerCudaFatbinaryRule(config));
// Link device code for each architecture.
for (const std::string& architectureKind : architectures) {
@@ -744,7 +744,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements(
cmStrCat(" -im=profile=sm_", architecture, ",file=", cubin);
fatbinary.ExplicitDeps.emplace_back(cubin);
- cmNinjaBuild dlink(LanguageLinkerCudaDeviceRule(config));
+ cmNinjaBuild dlink(this->LanguageLinkerCudaDeviceRule(config));
dlink.ExplicitDeps = explicitDeps;
dlink.Outputs = { cubin };
dlink.Variables["ARCH"] = cmStrCat("sm_", architecture);
@@ -767,7 +767,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements(
fatbinary);
// Compile the stub that registers the kernels and contains the fatbinaries.
- cmNinjaBuild dcompile(LanguageLinkerCudaDeviceCompileRule(config));
+ cmNinjaBuild dcompile(this->LanguageLinkerCudaDeviceCompileRule(config));
dcompile.Outputs = { output };
dcompile.ExplicitDeps = { cmStrCat(ninjaOutputDir, "/cmake_cuda_fatbin.h") };
dcompile.Variables["FATBIN"] =
@@ -787,7 +787,7 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement(
cmGeneratorTarget* genTarget = this->GetGeneratorTarget();
cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator();
- std::string targetOutputImplib = ConvertToNinjaPath(
+ std::string targetOutputImplib = this->ConvertToNinjaPath(
genTarget->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
if (config != fileConfig) {
@@ -806,7 +806,7 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement(
->GetFullName(fileConfig, cmStateEnums::ImportLibraryArtifact)
.empty() &&
targetOutputImplib ==
- ConvertToNinjaPath(genTarget->GetFullPath(
+ this->ConvertToNinjaPath(genTarget->GetFullPath(
fileConfig, cmStateEnums::ImportLibraryArtifact))) {
return;
}
@@ -882,16 +882,16 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement(
const std::string impLibPath = localGen.ConvertToOutputFormat(
targetOutputImplib, cmOutputConverter::SHELL);
vars["TARGET_IMPLIB"] = impLibPath;
- EnsureParentDirectoryExists(impLibPath);
+ this->EnsureParentDirectoryExists(impLibPath);
}
const std::string objPath =
- cmStrCat(GetGeneratorTarget()->GetSupportDirectory(),
+ cmStrCat(this->GetGeneratorTarget()->GetSupportDirectory(),
globalGen->ConfigDirectory(config));
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
this->ConvertToNinjaPath(objPath), cmOutputConverter::SHELL);
- EnsureDirectoryExists(objPath);
+ this->EnsureDirectoryExists(objPath);
this->SetMsvcTargetPdbVariable(vars, config);
@@ -933,21 +933,22 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator();
cmGeneratorTarget* gt = this->GetGeneratorTarget();
- std::string targetOutput = ConvertToNinjaPath(gt->GetFullPath(config));
- std::string targetOutputReal = ConvertToNinjaPath(
+ std::string targetOutput = this->ConvertToNinjaPath(gt->GetFullPath(config));
+ std::string targetOutputReal = this->ConvertToNinjaPath(
gt->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact,
/*realname=*/true));
- std::string targetOutputImplib = ConvertToNinjaPath(
+ std::string targetOutputImplib = this->ConvertToNinjaPath(
gt->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
if (config != fileConfig) {
- if (targetOutput == ConvertToNinjaPath(gt->GetFullPath(fileConfig))) {
+ if (targetOutput ==
+ this->ConvertToNinjaPath(gt->GetFullPath(fileConfig))) {
return;
}
if (targetOutputReal ==
- ConvertToNinjaPath(gt->GetFullPath(fileConfig,
- cmStateEnums::RuntimeBinaryArtifact,
- /*realname=*/true))) {
+ this->ConvertToNinjaPath(
+ gt->GetFullPath(fileConfig, cmStateEnums::RuntimeBinaryArtifact,
+ /*realname=*/true))) {
return;
}
if (!gt->GetFullName(config, cmStateEnums::ImportLibraryArtifact)
@@ -955,7 +956,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
!gt->GetFullName(fileConfig, cmStateEnums::ImportLibraryArtifact)
.empty() &&
targetOutputImplib ==
- ConvertToNinjaPath(gt->GetFullPath(
+ this->ConvertToNinjaPath(gt->GetFullPath(
fileConfig, cmStateEnums::ImportLibraryArtifact))) {
return;
}
@@ -1095,7 +1096,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
std::vector<std::string> extraISPCObjects =
this->GetGeneratorTarget()->GetGeneratedISPCObjects(config);
std::transform(extraISPCObjects.begin(), extraISPCObjects.end(),
- std::back_inserter(linkBuild.ExplicitDeps), MapToNinjaPath());
+ std::back_inserter(linkBuild.ExplicitDeps),
+ this->MapToNinjaPath());
linkBuild.ImplicitDeps =
this->ComputeLinkDeps(this->TargetLinkLanguage(config), config);
@@ -1189,7 +1191,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
const std::string impLibPath = localGen.ConvertToOutputFormat(
targetOutputImplib, cmOutputConverter::SHELL);
vars["TARGET_IMPLIB"] = impLibPath;
- EnsureParentDirectoryExists(impLibPath);
+ this->EnsureParentDirectoryExists(impLibPath);
if (gt->HasImportLibrary(config)) {
byproducts.push_back(targetOutputImplib);
if (firstForConfig) {
@@ -1218,7 +1220,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
cmStrCat(gt->GetSupportDirectory(), globalGen->ConfigDirectory(config));
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
this->ConvertToNinjaPath(objPath), cmOutputConverter::SHELL);
- EnsureDirectoryExists(objPath);
+ this->EnsureDirectoryExists(objPath);
std::string& linkLibraries = vars["LINK_LIBRARIES"];
std::string& link_path = vars["LINK_PATH"];
@@ -1247,11 +1249,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
localGen.AppendCustomCommandLines(ccg, *cmdLineLists[i]);
std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
std::transform(ccByproducts.begin(), ccByproducts.end(),
- std::back_inserter(byproducts), MapToNinjaPath());
+ std::back_inserter(byproducts), this->MapToNinjaPath());
std::transform(
ccByproducts.begin(), ccByproducts.end(),
std::back_inserter(globalGen->GetByproductsForCleanTarget()),
- MapToNinjaPath());
+ this->MapToNinjaPath());
}
}
}
@@ -1272,7 +1274,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
cmd += this->GetLocalGenerator()->ConvertToOutputFormat(
obj_list_file, cmOutputConverter::SHELL);
- cmProp nm_executable = GetMakefile()->GetDefinition("CMAKE_NM");
+ cmProp nm_executable = this->GetMakefile()->GetDefinition("CMAKE_NM");
if (cmNonempty(nm_executable)) {
cmd += " --nm=";
cmd += this->LocalCommonGenerator->ConvertToOutputFormat(
@@ -1325,7 +1327,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
// build response file name
std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG";
- cmProp flag = GetMakefile()->GetDefinition(cmakeLinkVar);
+ cmProp flag = this->GetMakefile()->GetDefinition(cmakeLinkVar);
bool const lang_supports_response =
!(this->TargetLinkLanguage(config) == "RC" ||