// SPDX-License-Identifier: LGPL-3.0-only // SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts® import std; import Crafter.Build; using namespace Crafter; // A project that returns one of the configurations it makes: the program. // It keeps to itself the library the program is built on, the program's // test, and a helper only that test is built on. None has a source: the // test loads this file and builds nothing of it. namespace { // One new set per call, at addresses that never change. std::deque Owned; } extern "C" std::vector CrafterBuildConfigurations(std::span) { Configuration& kept = Owned.emplace_back(); kept.path = "./"; kept.name = "kept"; kept.outputName = "kept"; kept.type = ConfigurationType::LibraryStatic; Configuration& helper = Owned.emplace_back(); helper.path = "./"; helper.name = "helper"; helper.outputName = "helper"; helper.type = ConfigurationType::LibraryStatic; Configuration& program = Owned.emplace_back(); program.path = "./"; program.name = "program"; program.outputName = "program"; program.type = ConfigurationType::Executable; program.dependencies = { &kept }; program.AddTest("KeptTest").Dependencies({ &program, &helper }); return { &program }; }