MCPcopy Create free account
hub / github.com/beefytech/Beef / DoCompile

Method DoCompile

BeefBoot/BootApp.cpp:475–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475void BootApp::DoCompile()
476{
477#ifdef BFBUILD_MAIN_THREAD_COMPILE
478 mOutputDirectory = outputDirectory;
479 CompileThread(this);
480#else
481
482 WorkThreadFunc workThread;
483 workThread.Start(CompileThread, this);
484
485 int lastProgressTicks = 0;
486
487 bool showProgress = mVerbosity >= Verbosity_Normal;
488
489 int progressSize = 30;
490 if (showProgress)
491 {
492 std::cout << "[";
493 for (int i = 0; i < progressSize; i++)
494 std::cout << " ";
495 std::cout << "]";
496 for (int i = 0; i < progressSize + 1; i++)
497 std::cout << "\b";
498 std::cout.flush();
499 }
500
501 while (true)
502 {
503 bool isDone = workThread.WaitForFinish(100);
504
505 float pct = BfCompiler_GetCompletionPercentage(mCompiler);
506 if (isDone)
507 pct = 1.0;
508 int progressTicks = (int)(pct * progressSize + 0.5f);
509
510 while (progressTicks > lastProgressTicks)
511 {
512 if (showProgress)
513 {
514 std::cout << "*";
515 std::cout.flush();
516 }
517 lastProgressTicks++;
518 }
519
520 if (isDone)
521 break;
522 }
523
524 if (showProgress)
525 std::cout << std::endl;
526#endif
527}
528
529struct OutputContext
530{

Callers

nothing calls this directly

Calls 4

CompileThreadFunction · 0.85
WaitForFinishMethod · 0.80
StartMethod · 0.45

Tested by

no test coverage detected