From 54b892139663914b3c04d46b178fabc56e930535 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Wed, 29 Apr 2026 20:16:30 +0200 Subject: [PATCH] crafter-build V2 --- project.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/project.cpp b/project.cpp index 820e445..6edce05 100644 --- a/project.cpp +++ b/project.cpp @@ -4,23 +4,13 @@ namespace fs = std::filesystem; using namespace Crafter; extern "C" Configuration CrafterBuildProject(std::span args) { - bool debug = false; - bool timing = false; - std::string target = "x86_64-pc-linux-gnu"; - for (std::string_view arg : args) { - if (arg == "--debug") debug = true; - else if (arg == "--timing") timing = true; - else if (arg.starts_with("--target=")) target = std::string(arg.substr(std::string_view("--target=").size())); - } - Configuration cfg; cfg.path = "./"; cfg.name = "Crafter.Event"; cfg.outputName = "Crafter.Event"; - cfg.target = target; cfg.type = ConfigurationType::LibraryStatic; - cfg.debug = debug; - if (timing) cfg.defines.push_back({"CRAFTER_TIMING", ""}); + auto opts = ApplyStandardArgs(cfg, args); + if (opts.Has("--timing")) cfg.defines.push_back({"CRAFTER_TIMING", ""}); std::array ifaces = { "interfaces/Crafter.Event" }; std::array impls = {};