From a7869c0bd65faacdd008284df9ab07de7df3d445 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 21 Nov 2021 11:13:28 +0100 Subject: Bundle flags in struct for easier passing around. --- src/libctor.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/libctor.h') 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 cxxflags; // flags for c++ compiler + std::vector cflags; // flags for c compiler + std::vector ldflags; // flags for linker + std::vector 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 sources; // source list std::vector depends; // internal target dependencies - std::vector cxxflags; // flags for c++ compiler - std::vector cflags; // flags for c compiler - std::vector ldflags; // flags for linker - std::vector asmflags; // flags for asm translator + Flags flags; std::vector externals; // externals used by this configuration }; @@ -69,10 +74,7 @@ int reg(BuildConfigurations (*cb)(), struct ExternalConfiguration { std::string name; // Name for configuration - std::vector cxxflags; // flags for c++ compiler - std::vector cflags; // flags for c compiler - std::vector ldflags; // flags for linker - std::vector asmflags; // flags for asm translator + Flags flags; std::vector libs; // libraries }; @@ -112,7 +114,7 @@ struct Configuration std::map env; // env used when last calling configure std::map tools; // tools - std::map> externals; + std::map externals; }; const Configuration& configuration(); -- cgit v1.2.3