summaryrefslogtreecommitdiff
path: root/src/libctor.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-06-08 17:38:01 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-06-09 22:28:32 +0200
commit7a16146600384272baf7fb2fc0fc64f59b17ffe9 (patch)
tree755df6191525a49862d957dc120dcbabcbb03f39 /src/libctor.h
parent69d6df33bf7fabe62cdcd61bcd7ebc20b6de6b67 (diff)
Function target type including support for generated sources.
Diffstat (limited to 'src/libctor.h')
-rw-r--r--src/libctor.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libctor.h b/src/libctor.h
index b539910..14fdf1d 100644
--- a/src/libctor.h
+++ b/src/libctor.h
@@ -9,6 +9,7 @@
#include <map>
#include <variant>
#include <cstddef>
+#include <functional>
enum class TargetType
{
@@ -20,6 +21,7 @@ enum class TargetType
Object,
UnitTest,
UnitTestLib,
+ Function,
};
enum class Language
@@ -69,6 +71,12 @@ struct Settings
int verbose{0}; // -1: completely silent, 0: normal, 1: verbose, ...
};
+struct BuildConfiguration;
+using GeneratorCb = std::function<int(const std::string& input,
+ const std::string& output,
+ const BuildConfiguration& config,
+ const Settings& settings)>;
+
struct BuildConfiguration
{
std::string name; // Name - used for referring in other configurations.
@@ -79,6 +87,7 @@ struct BuildConfiguration
std::vector<std::string> depends; // internal target dependencies
Flags flags;
std::vector<std::string> externals; // externals used by this configuration
+ GeneratorCb function;
};
using BuildConfigurations = std::vector<BuildConfiguration>;