Skip to content

Commit 5dea59f

Browse files
committed
Update toolchain_verify.cpp
1 parent cbf1cd1 commit 5dea59f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

buildcc/lib/toolchain/src/api/toolchain_verify.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,28 @@ ToolchainVerify<T>::Verify(const VerifyToolchainConfig &config) {
233233
vt.path = p;
234234
vt.compiler_version = env::trim(GetCompilerVersion(p, t).value_or(""));
235235
vt.target_arch = env::trim(GetCompilerArchitecture(p, t).value_or(""));
236-
verified_toolchains.push_back(vt);
236+
237+
// Check add
238+
bool add{true};
239+
if (config.compiler_version.has_value()) {
240+
add = add && (config.compiler_version.value() == vt.compiler_version);
241+
}
242+
if (config.target_arch.has_value()) {
243+
add = add && (config.target_arch.value() == vt.target_arch);
244+
}
245+
if (add) {
246+
verified_toolchains.push_back(vt);
247+
}
237248
}
238249

239250
// Reset
240251
matcher.FillWithToolchainFilenames();
241252
}
242253

254+
if (config.update && !verified_toolchains.empty()) {
255+
// TODO, Update logic here
256+
}
257+
243258
return verified_toolchains;
244259
}
245260

0 commit comments

Comments
 (0)