Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitffc095a

Browse files
committed
Update toolchain.rst
1 parent8bcbf4e commitffc095a

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

‎docs/source/user_api/toolchain.rst‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ toolchain_verify.h
2424

2525
..doxygenstruct::buildcc::ToolchainCompilerInfo
2626

27-
..doxygentypedef::ToolchainVerificationFunc
28-
2927
Example for Default Toolchain
3028
------------------------------
3129

@@ -62,13 +60,27 @@ Example for Custom Toolchain
6260
6361
BaseToolchain custom_toolchain(ToolchainId::Custom, "custom_new_toolchain", "assembler", "c_compiler", "cpp_compiler", "archiver", "linker");
6462
65-
// Find all the relevant toolchains on your host system
66-
std::vector<fs::path> found_toolchains = custom_toolchain.Find();
63+
// Toolchain::Find similar to previous example
6764
6865
// Find all the relevant toolchains on your host system
6966
// Selects the first found toolchain
7067
// Runs a verification function on the selected toolchain depending on the `ToolchainId`
71-
custom_toolchain.Verify();
68+
Toolchain::AddVerificationFunc(ToolchainId::Custom,
69+
[](const ToolchainExecutables & executables) {
70+
// Use executables to get compiler_version and target_arch
71+
if (success) {
72+
ToolchainCompilerInfo info;
73+
info.compiler_version = "compiler_version";
74+
info.target_arch = "target_arch";
75+
return info;
76+
} else {
77+
return {};
78+
}
79+
} -> std::optional<ToolchainCompilerInfo>, "custom_verification_func")
80+
81+
ToolchainVerifyConfig verify_config;
82+
verify_config.verification_identifier = "custom_verification_func";
83+
custom_toolchain.Verify(verify_config);
7284
7385
Specialized Toolchain
7486
=====================

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp