From 2855b6e1172d5b544b150bf617b216691801f574 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 22 Feb 2026 16:32:38 +0100 Subject: Make it possible to register header files along with the sources. --- src/ctor.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/ctor.h') diff --git a/src/ctor.h b/src/ctor.h index 182f97a..9320c3d 100644 --- a/src/ctor.h +++ b/src/ctor.h @@ -121,6 +121,33 @@ struct source using sources = std::vector; +struct header +{ + template + requires (( + std::is_convertible_v + ) && ...) + constexpr header(Args && ... arg) + { + ([&] + { + if constexpr(std::is_convertible_v) + { + file = arg; + } + else if constexpr(std::is_same_v) + { + install = arg; + } + }(), ...); + } + + std::string file; + ctor::install install; +}; + +using headers = std::vector; + enum class cxx_opt { // gcc/clang @@ -363,6 +390,7 @@ struct build_configuration std::is_same_v || std::is_same_v || std::is_same_v || + std::is_same_v || std::is_same_v || std::is_same_v || std::is_convertible_v || @@ -397,6 +425,10 @@ struct build_configuration { sources = arg; } + else if constexpr(std::is_same_v) + { + headers = arg; + } else if constexpr(std::is_same_v) { 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 depends; // internal target dependencies ctor::flags flags; std::vector externals; // externals used by this configuration -- cgit v1.2.3