import std; import Crafter.Build; namespace fs = std::filesystem; using namespace Crafter; extern "C" Configuration CrafterBuildProject(std::span) { // Host-only: verifies cross-project module imports work, doesn't exercise // any cross-compile path. See tests/Diamond for the same rationale. std::string target = HostTarget(); 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; }