| 473 | } |
| 474 | |
| 475 | void 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 | |
| 529 | struct OutputContext |
| 530 | { |
nothing calls this directly
no test coverage detected