import std; import Crafter.Build; namespace fs = std::filesystem; using namespace Crafter; extern "C" Configuration CrafterBuildProject(std::span) { static auto MathStatic = std::make_unique(); MathStatic->path = "./mathlib/"; MathStatic->name = "MathLib"; MathStatic->outputName = "MathLib"; MathStatic->target = "x86_64-pc-linux-gnu"; MathStatic->type = ConfigurationType::LibraryStatic; { std::array ifaces = { "MathLib" }; std::array impls = {}; MathStatic->GetInterfacesAndImplementations(ifaces, impls); } static auto GreetDynamic = std::make_unique(); GreetDynamic->path = "./greetlib/"; GreetDynamic->name = "GreetLib"; GreetDynamic->outputName = "GreetLib"; GreetDynamic->target = "x86_64-pc-linux-gnu"; GreetDynamic->type = ConfigurationType::LibraryDynamic; { std::array ifaces = { "GreetLib" }; std::array impls = {}; GreetDynamic->GetInterfacesAndImplementations(ifaces, impls); } Configuration app; app.path = "./"; app.name = "libs-app"; app.outputName = "libs-app"; app.target = "x86_64-pc-linux-gnu"; app.type = ConfigurationType::Executable; app.dependencies = { MathStatic.get(), GreetDynamic.get() }; { std::array ifaces = {}; std::array impls = { "main" }; app.GetInterfacesAndImplementations(ifaces, impls); } app.linkFlags.push_back("-Wl,--export-dynamic"); app.linkFlags.push_back("-ldl"); return app; }