| 610 | static constexpr StringView EXAMPLE_PROJECT_NAME = "SCExample"; |
| 611 | |
| 612 | namespace detail |
| 613 | { |
| 614 | Result findTaskflowBenchmarks(const Parameters& parameters, String& root, bool& found) |
| 615 | { |
| 616 | found = false; |
| 617 | |
| 618 | Tools::Download download; |
| 619 | download.packageName = "taskflow-benchmarks"; |
| 620 | |
| 621 | String packageDirectory = StringEncoding::Utf8; |
| 622 | SC_TRY(StringBuilder::format(packageDirectory, "{}_{}", download.packageName, download.packagePlatform)); |
| 623 | |
| 624 | String packageRoot = StringEncoding::Utf8; |
| 625 | SC_TRY(Path::join(packageRoot, {parameters.directories.packagesInstallDirectory.view(), packageDirectory.view()})); |
| 626 | |
| 627 | String receiptPath = StringEncoding::Utf8; |
| 628 | SC_TRY(Path::join(receiptPath, {packageRoot.view(), Tools::PackageReceiptFileName})); |
| 629 | |
| 630 | FileSystem fs; |
| 631 | SC_TRY(fs.init(".")); |
| 632 | if (not fs.existsAndIsFile(receiptPath.view())) |
| 633 | { |
| 634 | return Result(true); |
| 635 | } |
| 636 | |
| 637 | SC_TRY(Tools::resolvePackageExportPath(packageRoot.view(), Tools::PackageExport::TaskflowBenchmarksRoot, root)); |
| 638 | found = true; |
| 639 | return Result(true); |
| 640 | } |
| 641 | } // namespace detail |
| 642 | |
| 643 | Result configureExamplesGUI(const Parameters& parameters, Workspace& workspace) |
| 644 | { |
| 645 | Project project = {EXAMPLE_PROJECT_NAME, TargetType::GUIApplication}; |
| 646 | const bool isWindowsGNUTarget = parameters.platform == Platform::Windows and |
| 647 | (parameters.targetMachine.environment == TargetEnvironment::WindowsGNU or |
| 648 | parameters.toolchain.family == Toolchain::LLVMMingw); |
| 649 | |
| 650 | project.setRootDirectory(parameters.directories.projectDirectory.view()); |
| 651 | project.iconPath = "Documentation/Doxygen/SC.svg"; |
| 652 | |
| 653 | Tools::Package sokol; |
| 654 | SC_TRY(Tools::installSokol(parameters.directories, sokol)); |
| 655 | Tools::Package imgui; |
| 656 | SC_TRY(Tools::installDearImGui(parameters.directories, imgui)); |
| 657 | |
| 658 | project.addIncludePaths({".", sokol.packageLocalDirectory.view(), imgui.packageLocalDirectory.view()}); |
| 659 | project.addPresetConfiguration(Configuration::Preset::Debug, parameters); |
| 660 | project.addPresetConfiguration(Configuration::Preset::Release, parameters); |
| 661 | project.addPresetConfiguration(Configuration::Preset::DebugCoverage, parameters); |
| 662 | |
| 663 | configureSaneStrictNoStdCpp(project); |
| 664 | |
| 665 | SC_TRY(addSaneCppLibraries(project, parameters, Libraries::Multiple)); |
| 666 | SC_TRY(project.addIncludePaths({parameters.directories.libraryDirectory.view()})); |
| 667 | addSaneCppDebugVisualizers(project, parameters); |
| 668 | |
| 669 | project.addFiles(imgui.packageLocalDirectory.view(), "*.cpp"); |
no test coverage detected