Crafter.Build/examples/tests/project.cpp
Jorijn van der Graaf 8892154b28
Some checks failed
CI / build-test-release (push) Failing after 7m15s
linting
2026-07-23 01:24:42 +02:00

28 lines
904 B
C++

// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
import std;
import Crafter.Build;
namespace fs = std::filesystem;
using namespace Crafter;
// A pure library project: the root Configuration is the lib itself. Tests
// are declared with cfg.AddTest — one line per test, with deps and other
// options applied via the returned builder.
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view>) {
Configuration cfg;
cfg.path = "./mylib/";
cfg.name = "MyMath";
cfg.outputName = "MyMath";
cfg.target = "x86_64-pc-linux-gnu";
cfg.type = ConfigurationType::LibraryStatic;
std::array<fs::path, 1> ifaces = { "MyMath" };
std::array<fs::path, 0> impls = {};
cfg.GetInterfacesAndImplementations(ifaces, impls);
cfg.AddTest("Smoke");
cfg.AddTest("UnitMyMath").Dependencies({ &cfg });
return cfg;
}