summaryrefslogtreecommitdiff
path: root/src/libctor.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-09-25 11:06:50 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-09-25 11:14:36 +0200
commit019ee9f3026a419cd25916974d32fe1ebcff9578 (patch)
tree0e4edbdc40db6cff21d85613decb176ad2dd5378 /src/libctor.h
parentdcd084fa4abcde59d8e69c3fd24ec8685ad5065c (diff)
Add support for (optionally) explicitly declaring source language type in build configurations.
Diffstat (limited to 'src/libctor.h')
-rw-r--r--src/libctor.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/libctor.h b/src/libctor.h
index 6903c6b..6026ffb 100644
--- a/src/libctor.h
+++ b/src/libctor.h
@@ -33,13 +33,27 @@ enum class OutputSystem
Build, // Internal tool during cross-compilation
};
+struct Source
+{
+ Source(const char* file)
+ : file(file) {}
+ Source(const std::string& file)
+ : file(file) {}
+ Source(const char* file, Language language)
+ : file(file), language(language) {}
+ Source(const std::string& file, Language language)
+ : file(file), language(language) {}
+
+ std::string file;
+ Language language{Language::Auto};
+};
+
struct BuildConfiguration
{
TargetType type{TargetType::Auto};
- Language language{Language::Auto};
OutputSystem system{OutputSystem::Host};
std::string target;
- std::vector<std::string> sources; // source list
+ std::vector<Source> sources; // source list
std::vector<std::string> depends; // internal dependencies
std::vector<std::string> cxxflags; // flags for c++ compiler
std::vector<std::string> cflags; // flags for c compiler