File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
buildcc/lib/toolchain/include/toolchain/api Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1818#define TOOLCHAIN_TOOLCHAIN_VERIFY_H_
1919
2020#include < filesystem>
21+ #include < optional>
2122#include < vector>
2223
2324#include " env/logging.h"
@@ -42,6 +43,13 @@ namespace buildcc::base {
4243struct VerifyToolchainConfig {
4344 std::vector<std::string> absolute_search_paths;
4445 std::vector<std::string> env_vars{" PATH" };
46+
47+ std::optional<std::string> compiler_version;
48+ std::optional<std::string> target_arch;
49+
50+ // Updates the toolchain with absolute paths once verified
51+ // If multiple toolchains are found, uses the first in the list
52+ bool update{true };
4553};
4654
4755/* *
@@ -60,8 +68,21 @@ struct VerifiedToolchain {
6068
6169template <typename T> class ToolchainVerify {
6270public:
71+ /* *
72+ * @brief Verify your toolchain executables by searching your operating system
73+ * paths
74+ * Only add the verified path IF all toolchain executables are matched
75+ *
76+ * @param config Search paths to find toolchains
77+ * @return std::vector<VerifiedToolchain> Operating system can contain
78+ * multiple toolchains of similar names with different versions. Collect all
79+ * of them
80+ */
6381 std::vector<VerifiedToolchain>
6482 Verify (const VerifyToolchainConfig &config = VerifyToolchainConfig());
83+
84+ protected:
85+ VerifiedToolchain verified_toolchain_;
6586};
6687
6788} // namespace buildcc::base
You can’t perform that action at this time.
0 commit comments