summaryrefslogtreecommitdiff
path: root/src/libctor.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-11-21 11:13:28 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2021-11-21 13:26:29 +0100
commita7869c0bd65faacdd008284df9ab07de7df3d445 (patch)
tree8d83ab0b23cd504ddf5c5eeddf5a322fd81db3ed /src/libctor.h
parent28531aed4d1654cdb6f590e92448bc0ba3ab755b (diff)
Bundle flags in struct for easier passing around.
Diffstat (limited to 'src/libctor.h')
-rw-r--r--src/libctor.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/libctor.h b/src/libctor.h
index a5fd249..0af33cb 100644
--- a/src/libctor.h
+++ b/src/libctor.h
@@ -45,6 +45,14 @@ struct Source
Language language{Language::Auto};
};
+struct Flags
+{
+ std::vector<std::string> cxxflags; // flags for c++ compiler
+ std::vector<std::string> cflags; // flags for c compiler
+ std::vector<std::string> ldflags; // flags for linker
+ std::vector<std::string> asmflags; // flags for asm translator
+};
+
struct BuildConfiguration
{
std::string name; // Name - used for referring in other configurations.
@@ -53,10 +61,7 @@ struct BuildConfiguration
std::string target; // Output target file for this configuration
std::vector<Source> sources; // source list
std::vector<std::string> depends; // internal target dependencies
- std::vector<std::string> cxxflags; // flags for c++ compiler
- std::vector<std::string> cflags; // flags for c compiler
- std::vector<std::string> ldflags; // flags for linker
- std::vector<std::string> asmflags; // flags for asm translator
+ Flags flags;
std::vector<std::string> externals; // externals used by this configuration
};
@@ -69,10 +74,7 @@ int reg(BuildConfigurations (*cb)(),
struct ExternalConfiguration
{
std::string name; // Name for configuration
- std::vector<std::string> cxxflags; // flags for c++ compiler
- std::vector<std::string> cflags; // flags for c compiler
- std::vector<std::string> ldflags; // flags for linker
- std::vector<std::string> asmflags; // flags for asm translator
+ Flags flags;
std::vector<std::string> libs; // libraries
};
@@ -112,7 +114,7 @@ struct Configuration
std::map<std::string, std::string> env; // env used when last calling configure
std::map<std::string, std::string> tools; // tools
- std::map<std::string, std::vector<std::string>> externals;
+ std::map<std::string, Flags> externals;
};
const Configuration& configuration();