@@ -24,16 +24,51 @@ toolchain_verify.h
2424
2525..doxygenstruct ::buildcc::ToolchainCompilerInfo
2626
27- Example
28- --------
27+ ..doxygentypedef ::ToolchainVerificationFunc
28+
29+ Example for Default Toolchain
30+ ------------------------------
31+
32+ ..code-block ::cpp
33+ :linenos:
34+
35+ BaseToolchain arm_gcc(ToolchainId::Gcc, "arm-none-eabi-gcc", "arm-none-eabi-as", "arm-none-eabi-gcc", "arm-none-eabi-g++", "arm-none-eabi-ar", "arm-none-eabi-ld");
36+
37+ // Toolchain::Find is only used to return a list of paths where the ToolchainExecutables are found
38+ // NOTE: All ToolchainExecutables must be found in a single directory for it to be present in the list
39+ {
40+ ToolchainFindConfig find_config;
41+ // Modify it here if needed
42+ auto found_toolchains = arm_gcc.Find(find_config);
43+ }
44+
45+ // Runs Toolchain::Find
46+ // Selects first found toolchain (update ToolchainVerifyConfig if you want to select a different toolchain for verification)
47+ // Runs a pre-added ToolchainId::GCC verification function
48+ // If Verification Fails: Terminates the program
49+ // Else: Updates the arm_gcc ToolchainExecutables to the full path
50+ // i.e `arm-none-eabi-gcc` becomes `{host_absolute_path}/arm-none-eabi-gcc{host_executable_extension}`
51+ {
52+ ToolchainVerifyConfig verify_config;
53+ // Modify it here if needed
54+ arm_gcc.Verify(verify_config);
55+ }
56+
57+ Example for Custom Toolchain
58+ ----------------------------
2959
3060..code-block ::cpp
3161 :linenos:
3262
33- BaseToolchain custom_toolchain(ToolchainId::Custom, "custom_new_toolchain", "asm_compiler", "c_compiler", "cpp_compiler", "archiver", "linker");
63+ BaseToolchain custom_toolchain(ToolchainId::Custom, "custom_new_toolchain", "assembler", "c_compiler", "cpp_compiler", "archiver", "linker");
64+
65+ // Find all the relevant toolchains on your host system
66+ std::vector<fs::path> found_toolchains = custom_toolchain.Find();
3467
35- std::vector<VerifiedToolchain> verified_toolchains = custom_toolchain.Verify();
36- env::assert_fatal(!verified_toolchains.empty(), "Toolchain not found");
68+ // Find all the relevant toolchains on your host system
69+ // Selects the first found toolchain
70+ // Runs a verification function on the selected toolchain depending on the `ToolchainId`
71+ custom_toolchain.Verify();
3772
3873 Specialized Toolchain
3974=====================