Compare commits

...

2 commits

Author SHA1 Message Date
60131b5cc7 Merge branch 'master' of https://forgejo.catcrafts.net/Catcrafts/Crafter.Build
Some checks failed
CI / build-test-release (push) Failing after 16m29s
2026-05-27 04:36:24 +02:00
54f02b1e17 got rid of --local 2026-05-27 04:36:11 +02:00

View file

@ -5,28 +5,14 @@ using namespace Crafter;
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
std::vector<std::string> depArgs(args.begin(), args.end());
// Local-mode resolution for the Crafter.Math/Crafter.Asset deps that the
// self-host pass links in (so `cfg.assets` calls CompressAsset → Crafter.Asset
// in-process). `--local` points at sibling working trees instead of git;
// useful during cross-repo development so edits in ../Crafter.Asset are
// picked up without commit-and-pull.
bool useLocal = false;
for (std::string_view a : args) {
if (a == "--local") { useLocal = true; break; }
}
auto resolveDep = [&](std::string_view name, std::string_view gitUrl) -> Configuration* {
if (useLocal) {
return LocalProject({
.projectFile = fs::path("../") / name / "project.cpp",
.args = depArgs,
});
}
return GitProject({
.source = { .url = std::string(gitUrl) },
.args = depArgs,
});
};
Configuration* math = GitProject({
.source = { "https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git" },
.args = depArgs,
});
Configuration* asset = GitProject({
.source = { "https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset.git" },
.args = depArgs,
});
static auto crafterBuildLib = std::make_unique<Configuration>();
crafterBuildLib->path = "./";
@ -39,12 +25,7 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
crafterBuildLib->type = (crafterBuildLib->target == "x86_64-w64-mingw32" || crafterBuildLib->target == "x86_64-pc-windows-msvc")
? ConfigurationType::LibraryDynamic
: ConfigurationType::LibraryStatic;
// Self-host pass links Crafter.Asset (and its Crafter.Math dep) into the
// crafter-build binary so cfg.assets can call CompressAsset in-process.
// The bootstrap (build.sh) defines no such dep — its impl unit takes the
// stub branch and cfg.assets errors at runtime until a self-host rebuild.
Configuration* math = resolveDep("Crafter.Math", "https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git");
Configuration* asset = resolveDep("Crafter.Asset", "https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset.git");
crafterBuildLib->dependencies = { math, asset };
crafterBuildLib->defines.push_back({"CRAFTER_BUILD_HAS_ASSET", ""});
{