MCPcopy Create free account
hub / github.com/Kitware/CMake / CreateRuleFile

Method CreateRuleFile

Source/cmMakefileTargetGenerator.cxx:163–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void cmMakefileTargetGenerator::CreateRuleFile()
164{
165 // Create a directory for this target.
166 this->TargetBuildDirectoryFull =
167 this->GeneratorTarget->GetSupportDirectory();
168 this->TargetBuildDirectory = this->LocalGenerator->MaybeRelativeToCurBinDir(
169 this->TargetBuildDirectoryFull);
170 cmSystemTools::MakeDirectory(this->TargetBuildDirectoryFull);
171
172 // Construct the rule file name.
173 this->BuildFileName = cmStrCat(this->TargetBuildDirectory, "/build.make");
174 this->BuildFileNameFull =
175 cmStrCat(this->TargetBuildDirectoryFull, "/build.make");
176
177 // Construct the rule file name.
178 this->ProgressFileNameFull =
179 cmStrCat(this->TargetBuildDirectoryFull, "/progress.make");
180
181 // reset the progress count
182 this->NumberOfProgressActions = 0;
183
184 // Open the rule file. This should be copy-if-different because the
185 // rules may depend on this file itself.
186 this->BuildFileStream = cm::make_unique<cmGeneratedFileStream>(
187 this->BuildFileNameFull, false,
188 this->GlobalGenerator->GetMakefileEncoding());
189 if (!this->BuildFileStream) {
190 return;
191 }
192 this->BuildFileStream->SetCopyIfDifferent(true);
193 this->LocalGenerator->WriteDisclaimer(*this->BuildFileStream);
194 if (this->GlobalGenerator->AllowDeleteOnError()) {
195 std::vector<std::string> no_depends;
196 std::vector<std::string> no_commands;
197 this->LocalGenerator->WriteMakeRule(
198 *this->BuildFileStream, "Delete rule output on recipe failure.",
199 ".DELETE_ON_ERROR", no_depends, no_commands, false);
200 }
201 this->LocalGenerator->WriteSpecialTargetsTop(*this->BuildFileStream);
202}
203
204void cmMakefileTargetGenerator::WriteTargetBuildRules()
205{

Callers 3

WriteRuleFilesMethod · 0.80
WriteRuleFilesMethod · 0.80
WriteRuleFilesMethod · 0.80

Calls 9

GetSupportDirectoryMethod · 0.80
SetCopyIfDifferentMethod · 0.80
cmStrCatFunction · 0.70
GetMakefileEncodingMethod · 0.45
WriteDisclaimerMethod · 0.45
AllowDeleteOnErrorMethod · 0.45
WriteMakeRuleMethod · 0.45

Tested by

no test coverage detected