diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ctor.h | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -121,6 +121,33 @@ struct source using sources = std::vector<ctor::source>; +struct header +{ + template <class ... Args> + requires (( + std::is_convertible_v<Args, std::string_view> + ) && ...) + constexpr header(Args && ... arg) + { + ([&] + { + if constexpr(std::is_convertible_v<Args, std::string_view>) + { + file = arg; + } + else if constexpr(std::is_same_v<Args, ctor::install>) + { + install = arg; + } + }(), ...); + } + + std::string file; + ctor::install install; +}; + +using headers = std::vector<ctor::header>; + enum class cxx_opt { // gcc/clang @@ -363,6 +390,7 @@ struct build_configuration std::is_same_v<Args, ctor::output_system> || std::is_same_v<Args, ctor::target> || std::is_same_v<Args, ctor::sources> || + std::is_same_v<Args, ctor::headers> || std::is_same_v<Args, ctor::depends> || std::is_same_v<Args, ctor::externals> || std::is_convertible_v<Args, ctor::GeneratorOneToOne> || @@ -397,6 +425,10 @@ struct build_configuration { sources = arg; } + else if constexpr(std::is_same_v<Args, ctor::headers>) + { + headers = arg; + } else if constexpr(std::is_same_v<Args, ctor::depends>) { depends = arg.depends; @@ -441,6 +473,7 @@ struct build_configuration ctor::output_system system{ctor::output_system::build}; std::string target; // Output target file for this configuration ctor::sources sources; // source list + ctor::headers headers; // header list std::vector<std::string> depends; // internal target dependencies ctor::flags flags; std::vector<std::string> externals; // externals used by this configuration |
