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

Method Generate

Source/cmLocalUnixMakefileGenerator3.cxx:156–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void cmLocalUnixMakefileGenerator3::Generate()
157{
158 // Record whether some options are enabled to avoid checking many
159 // times later.
160 if (!this->GetGlobalGenerator()->GetCMakeInstance()->GetIsInTryCompile()) {
161 if (this->Makefile->IsSet("CMAKE_COLOR_MAKEFILE")) {
162 this->ColorMakefile = this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE");
163 } else {
164 this->ColorMakefile = this->Makefile->IsOn("CMAKE_COLOR_DIAGNOSTICS");
165 }
166 }
167 this->SkipPreprocessedSourceRules =
168 this->Makefile->IsOn("CMAKE_SKIP_PREPROCESSED_SOURCE_RULES");
169 this->SkipAssemblySourceRules =
170 this->Makefile->IsOn("CMAKE_SKIP_ASSEMBLY_SOURCE_RULES");
171
172 // Generate the rule files for each target.
173 cmGlobalUnixMakefileGenerator3* gg =
174 static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
175 for (cmGeneratorTarget* gt :
176 this->GlobalGenerator->GetLocalGeneratorTargetsInOrder(this)) {
177 if (!gt->IsInBuildSystem()) {
178 continue;
179 }
180
181 auto& gtVisited = this->GetCommandsVisited(gt);
182 auto const& deps = this->GlobalGenerator->GetTargetDirectDepends(gt);
183 for (auto const& d : deps) {
184 // Take the union of visited source files of custom commands
185 auto depVisited = this->GetCommandsVisited(d);
186 gtVisited.insert(depVisited.begin(), depVisited.end());
187 }
188
189 std::unique_ptr<cmMakefileTargetGenerator> tg(
190 cmMakefileTargetGenerator::New(gt));
191 if (tg) {
192 tg->WriteRuleFiles();
193 gg->RecordTargetProgress(tg.get());
194 }
195 }
196
197 // write the local Makefile
198 this->WriteLocalMakefile();
199
200 // Write the cmake file with information for this directory.
201 this->WriteDirectoryInformationFile();
202}
203
204std::string cmLocalUnixMakefileGenerator3::GetObjectOutputRoot(
205 cmStateEnums::IntermediateDirKind kind) const

Callers

nothing calls this directly

Calls 15

WriteLocalMakefileMethod · 0.95
GetIsInTryCompileMethod · 0.80
IsInBuildSystemMethod · 0.80
RecordTargetProgressMethod · 0.80
GetCMakeInstanceMethod · 0.45
GetGlobalGeneratorMethod · 0.45
IsSetMethod · 0.45
IsOnMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected