got rid of --local
This commit is contained in:
parent
2b7e37e3b9
commit
54f02b1e17
1 changed files with 9 additions and 28 deletions
37
project.cpp
37
project.cpp
|
|
@ -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", ""});
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue