summaryrefslogtreecommitdiff
path: root/src/ctor.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-12-09 08:32:57 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2024-12-09 08:32:57 +0100
commit5ba36c7be0a12b9b052fb172a209d3b6dffc9a99 (patch)
treea3bc5ffe0766c634e417e40ce6b55f8a2b2ee88d /src/ctor.h
parent6cc2e195700e6ce02c04160c0c93af6d325d89d7 (diff)
Add support for toolchain specific sourcestoolchain_sources
Diffstat (limited to 'src/ctor.h')
-rw-r--r--src/ctor.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/ctor.h b/src/ctor.h
index 8204f70..1de4aec 100644
--- a/src/ctor.h
+++ b/src/ctor.h
@@ -10,6 +10,7 @@
#include <variant>
#include <cstddef>
#include <functional>
+#include <string_view>
namespace ctor {
@@ -52,6 +53,14 @@ enum class arch
unknown, //!< Target platform architecture has not yet detected or was not possible to detect
};
+enum class toolchain
+{
+ any,
+ none,
+ gcc,
+ clang,
+};
+
struct source
{
constexpr source(const char* file) : file(file) {} // convenience ctor
@@ -62,19 +71,19 @@ struct source
constexpr source(std::string_view file, std::string_view output) : file(file), output(output) {}
constexpr source(std::string_view file, ctor::language lang, std::string_view output) : file(file), language(lang), output(output) {}
+ constexpr source(ctor::toolchain toolchain, std::string_view file) : file(file), toolchain(toolchain) {}
+ constexpr source(ctor::toolchain toolchain, std::string_view file, ctor::language lang) : file(file), toolchain(toolchain), language(lang) {}
+
+ constexpr source(ctor::toolchain toolchain, std::string_view file, std::string_view output) : file(file), toolchain(toolchain), output(output) {}
+
+ constexpr source(ctor::toolchain toolchain, std::string_view file, ctor::language lang, std::string_view output) : file(file), toolchain(toolchain), language(lang), output(output) {}
+
std::string file;
+ ctor::toolchain toolchain{ctor::toolchain::any};
ctor::language language{ctor::language::automatic};
std::string output{};
};
-enum class toolchain
-{
- any,
- none,
- gcc,
- clang,
-};
-
enum class cxx_opt
{
// gcc/clang