MCPcopy Create free account
hub / github.com/KDE/kdevelop / configureIfRequired

Method configureIfRequired

plugins/meson/mesonbuilder.cpp:203–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203KJob* MesonBuilder::configureIfRequired(KDevelop::IProject* project, KJob* realJob)
204{
205 Q_ASSERT(project);
206 Meson::BuildDir buildDir = Meson::currentBuildDir(project);
207 DirectoryStatus status = evaluateBuildDirectory(buildDir.buildDir, buildDir.mesonBackend);
208
209 if (status == MESON_CONFIGURED) {
210 return realJob;
211 }
212
213 KJob* configureJob = nullptr;
214 if (buildDir.isValid()) {
215 configureJob = configure(project, buildDir, {}, status);
216 } else {
217 // Create a new build directory
218 auto* bsm = project->buildSystemManager();
219 auto* manager = dynamic_cast<MesonManager*>(bsm);
220 if (!manager) {
221 return new ErrorJob(this, i18n("Internal error: The buildsystem manager is not the MesonManager"));
222 }
223
224 configureJob = manager->newBuildDirectory(project);
225 if (!configureJob) {
226 return new ErrorJob(this, i18n("Failed to create a new build directory"));
227 }
228 }
229
230 QList<KJob*> jobs = {
231 configure(project, buildDir, {}, status), // First configure the build directory
232 realJob // If this succeeds execute the real job
233 };
234
235 return new ExecuteCompositeJob(this, jobs);
236}
237
238KJob* MesonBuilder::build(KDevelop::ProjectBaseItem* item)
239{

Callers

nothing calls this directly

Calls 4

currentBuildDirFunction · 0.85
buildSystemManagerMethod · 0.80
newBuildDirectoryMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected