MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / configureExamplesGUI

Function configureExamplesGUI

Tools/SC-build.cpp:612–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610static constexpr StringView EXAMPLE_PROJECT_NAME = "SCExample";
611
612namespace detail
613{
614Result 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
643Result 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");

Callers 1

configureFunction · 0.85

Calls 10

installSokolFunction · 0.85
installDearImGuiFunction · 0.85
ErrorEnum · 0.50
ResultClass · 0.50
viewMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected