From bce4efdae37898edfbfcd806453f94485c156bc1 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 6 Jan 2025 18:15:05 +0100 Subject: Add dual-arg flags and add debug flag with name and optional value. --- src/ctor.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/ctor.h') diff --git a/src/ctor.h b/src/ctor.h index e0e2bef..0892364 100644 --- a/src/ctor.h +++ b/src/ctor.h @@ -98,6 +98,7 @@ enum class cxx_opt optimization, // -O position_independent_code, // -fPIC position_independent_executable, // -fPIE + define, // -D[=] custom, // entire option taken verbatim from }; @@ -115,6 +116,7 @@ enum class c_opt optimization, // -O position_independent_code, // -fPIC position_independent_executable, // -fPIE + define, // -D[=] custom, // entire option taken verbatim from }; @@ -159,15 +161,21 @@ public: flag(std::string_view str); flag(const char* str); flag(T opt_) : opt(opt_) {} - flag(T opt_, std::string_view arg_) : opt(opt_), arg(arg_) {} - flag(T opt_, const char* arg_) : opt(opt_), arg(arg_) {} - flag(ctor::toolchain toolchain_, T opt_) : toolchain(toolchain_), opt(opt_) {} - flag(ctor::toolchain toolchain_, T opt_, const char* arg_) : toolchain(toolchain_), opt(opt_), arg(arg_) {} - flag(ctor::toolchain toolchain_, T opt_, std::string_view arg_) : toolchain(toolchain_), opt(opt_), arg(arg_) {} + flag(T opt_, std::string_view arg_, std::string_view arg2_ = "") + : opt(opt_), arg(arg_), arg2(arg2_) {} + flag(T opt_, const char* arg_, const char* arg2_ = "") + : opt(opt_), arg(arg_), arg2(arg2_) {} + flag(ctor::toolchain toolchain_, T opt_) + : toolchain(toolchain_), opt(opt_) {} + flag(ctor::toolchain toolchain_, T opt_, const char* arg_, const char* arg2_ = "") + : toolchain(toolchain_), opt(opt_), arg(arg_), arg2(arg2_) {} + flag(ctor::toolchain toolchain_, T opt_, std::string_view arg_, std::string_view arg2_ = "") + : toolchain(toolchain_), opt(opt_), arg(arg_), arg2(arg2_) {} ctor::toolchain toolchain{ctor::toolchain::any}; T opt{}; std::string arg; + std::string arg2; }; using c_flag = ctor::flag; -- cgit v1.2.3