Skip to content

Commit ffa64f1

Browse files
committed
Update toolchain_verify.cpp
1 parent e659571 commit ffa64f1

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

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

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,32 @@ ToolchainVerify<T>::Verify(const VerifyToolchainConfig &config) {
252252
}
253253

254254
if (config.update && !verified_toolchains.empty()) {
255+
constexpr const char *os_executable_ext =
256+
buildcc::env::get_os_executable_extension();
257+
buildcc::env::assert_fatal<os_executable_ext != nullptr>(
258+
"OS not supported");
259+
255260
verified_toolchain_ = verified_toolchains[0];
256-
t.asm_compiler_ =
257-
(verified_toolchain_.path / t.asm_compiler_).make_preferred().string();
258-
t.c_compiler_ =
259-
(verified_toolchain_.path / t.c_compiler_).make_preferred().string();
260-
t.cpp_compiler_ =
261-
(verified_toolchain_.path / t.cpp_compiler_).make_preferred().string();
262-
t.archiver_ =
263-
(verified_toolchain_.path / t.archiver_).make_preferred().string();
264-
t.linker_ =
265-
(verified_toolchain_.path / t.linker_).make_preferred().string();
261+
t.asm_compiler_ = (verified_toolchain_.path /
262+
fmt::format("{}{}", t.asm_compiler_, os_executable_ext))
263+
.make_preferred()
264+
.string();
265+
t.c_compiler_ = (verified_toolchain_.path /
266+
fmt::format("{}{}", t.c_compiler_, os_executable_ext))
267+
.make_preferred()
268+
.string();
269+
t.cpp_compiler_ = (verified_toolchain_.path /
270+
fmt::format("{}{}", t.cpp_compiler_, os_executable_ext))
271+
.make_preferred()
272+
.string();
273+
t.archiver_ = (verified_toolchain_.path /
274+
fmt::format("{}{}", t.archiver_, os_executable_ext))
275+
.make_preferred()
276+
.string();
277+
t.linker_ = (verified_toolchain_.path /
278+
fmt::format("{}{}", t.linker_, os_executable_ext))
279+
.make_preferred()
280+
.string();
266281
}
267282

268283
return verified_toolchains;

0 commit comments

Comments
 (0)