summaryrefslogtreecommitdiff
path: root/src/ctor.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2025-01-06 18:15:05 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2025-01-06 18:15:05 +0100
commitbce4efdae37898edfbfcd806453f94485c156bc1 (patch)
tree439e15499c65bf02d0ecca8ba5dbb448d346907f /src/ctor.h
parent05a15ed660f8b43c85242fed1a863853e8c749b3 (diff)
Add dual-arg flags and add debug flag with name and optional value.
Diffstat (limited to 'src/ctor.h')
-rw-r--r--src/ctor.h18
1 files changed, 13 insertions, 5 deletions
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<arg>
position_independent_code, // -fPIC
position_independent_executable, // -fPIE
+ define, // -D<arg>[=<arg2>]
custom, // entire option taken verbatim from <arg>
};
@@ -115,6 +116,7 @@ enum class c_opt
optimization, // -O<arg>
position_independent_code, // -fPIC
position_independent_executable, // -fPIE
+ define, // -D<arg>[=<arg2>]
custom, // entire option taken verbatim from <arg>
};
@@ -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<ctor::c_opt>;