import std; import Crafter.Build; namespace fs = std::filesystem; using namespace Crafter; extern "C" Configuration CrafterBuildProject(std::span args) { std::string target = "x86_64-pc-linux-gnu"; for (auto a : args) { if (a.starts_with("--target=")) target = std::string(a.substr(9)); } static auto fooLib = std::make_unique(); fooLib->path = "tests/CrossProjectModule/lib/"; fooLib->name = std::format("Foo-{}", target); fooLib->outputName = "Foo"; fooLib->target = target; fooLib->type = ConfigurationType::LibraryStatic; { std::array ifaces = { "Foo" }; std::array impls = {}; fooLib->GetInterfacesAndImplementations(ifaces, impls); } Configuration cfg; cfg.path = "tests/CrossProjectModule/"; cfg.name = "CrossProjectModule"; cfg.outputName = "cross-app"; cfg.target = target; cfg.type = ConfigurationType::Executable; cfg.dependencies = { fooLib.get() }; std::array ifaces = {}; std::array impls = { "main" }; cfg.GetInterfacesAndImplementations(ifaces, impls); return cfg; }