Crafter.Debug/tooling/project.cpp

31 lines
1.4 KiB
C++
Raw Normal View History

// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
// The build helper consumers load through
// #pragma crafter dependency "https://forgejo.catcrafts.net/Catcrafts/Crafter.Debug.git" project "tooling/project.cpp"
// A separate project file because a pragma dependency is built for the host
// and gets none of the consumer's args, so the root project.cpp could not
// tell this load from the one that builds the library for the target.
//
// No dependency on Crafter.Build, as in Crafter.LintRules: this module only
// ever runs inside a crafter-build process, which provides the symbols, and
// the host build already sees the Crafter.Build modules through the PCM cache
// crafter-build keeps for project files. Nor on anything else: whatever this
// imported would be built on every load of every consumer.
import std;
import Crafter.Build;
namespace fs = std::filesystem;
using namespace Crafter;
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
Configuration cfg;
cfg.path = "./";
cfg.name = "Crafter.Debug.Build";
cfg.outputName = "Crafter.Debug.Build";
cfg.type = ConfigurationType::LibraryStatic;
ApplyStandardArgs(cfg, args);
std::array<fs::path, 1> interfaces = { "interfaces/Crafter.Debug.Build" };
std::array<fs::path, 0> implementations = {};
cfg.GetInterfacesAndImplementations(interfaces, implementations);
return cfg;
}