36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
|
|
import std;
|
||
|
|
import Crafter.Build;
|
||
|
|
namespace fs = std::filesystem;
|
||
|
|
using namespace Crafter;
|
||
|
|
|
||
|
|
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> 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<Configuration>();
|
||
|
|
fooLib->path = "tests/CrossProjectModule/lib/";
|
||
|
|
fooLib->name = std::format("Foo-{}", target);
|
||
|
|
fooLib->outputName = "Foo";
|
||
|
|
fooLib->target = target;
|
||
|
|
fooLib->type = ConfigurationType::LibraryStatic;
|
||
|
|
{
|
||
|
|
std::array<fs::path, 1> ifaces = { "Foo" };
|
||
|
|
std::array<fs::path, 0> 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<fs::path, 0> ifaces = {};
|
||
|
|
std::array<fs::path, 1> impls = { "main" };
|
||
|
|
cfg.GetInterfacesAndImplementations(ifaces, impls);
|
||
|
|
return cfg;
|
||
|
|
}
|