summaryrefslogtreecommitdiff
path: root/src/libctor.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-06-08 17:31:36 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-06-09 22:25:15 +0200
commit61f7f7538cc6abb0be64c35570f38dd2541d7451 (patch)
tree092c97084f191eb502b06740a76658432dada34a /src/libctor.h
parentd9cb571fe126e7e94a52361d733161aa25f23597 (diff)
Add const Settings& to build configuration callbacks.
Diffstat (limited to 'src/libctor.h')
-rw-r--r--src/libctor.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libctor.h b/src/libctor.h
index 70f2c3e..f80a5c5 100644
--- a/src/libctor.h
+++ b/src/libctor.h
@@ -8,6 +8,7 @@
#include <vector>
#include <map>
#include <variant>
+#include <cstddef>
enum class TargetType
{
@@ -55,6 +56,13 @@ struct Flags
std::vector<std::string> asmflags; // flags for asm translator
};
+struct Settings
+{
+ std::string builddir{"build"};
+ std::size_t parallel_processes{1};
+ int verbose{0}; // -1: completely silent, 0: normal, 1: verbose, ...
+};
+
struct BuildConfiguration
{
std::string name; // Name - used for referring in other configurations.
@@ -69,7 +77,7 @@ struct BuildConfiguration
using BuildConfigurations = std::vector<BuildConfiguration>;
-int reg(BuildConfigurations (*cb)(),
+int reg(BuildConfigurations (*cb)(const Settings&),
const std::source_location location = std::source_location::current());
// This type will use flags verbatim
@@ -87,7 +95,7 @@ struct ExternalConfiguration
using ExternalConfigurations = std::vector<ExternalConfiguration>;
-int reg(ExternalConfigurations (*cb)(),
+int reg(ExternalConfigurations (*cb)(const Settings&),
const std::source_location location = std::source_location::current());
// Convenience macro - ugly but keeps things simple(r)