Skip to content

Commit cbf1cd1

Browse files
committed
Updated toolchain_verify config options
1 parent a45bbbc commit cbf1cd1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

buildcc/lib/toolchain/include/toolchain/api/toolchain_verify.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
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 {
4243
struct 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

6169
template <typename T> class ToolchainVerify {
6270
public:
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

0 commit comments

Comments
 (0)