// SPDX-License-Identifier: LGPL-3.0-only // SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts® import std; import Crafter.Build; using namespace Crafter; // Returns what the project beside it keeps to itself, which the load // refuses: the library keeper's program is built on, or with --test the // configuration of the program's test, or with --test-dependency the helper // only that test is built on. keeper's own file returns none of the three. extern "C" std::vector CrafterBuildConfigurations(std::span args) { // The test loads this file from digger/, so the path resolves against // it. No args, so that keeper is loaded once whatever this file was // given. Configuration* program = LocalProject({ .projectFile = "../keeper/project.cpp", .args = {} }); if (std::ranges::contains(args, std::string_view("--test"))) return { &program->tests[0].config }; if (std::ranges::contains(args, std::string_view("--test-dependency"))) return { program->tests[0].config.dependencies[1] }; return { program->dependencies[0] }; }