Is there an existing issue for this?
Current Behavior
In the use cases such as using llvm-libc as overlay C lib or explicitly using another C lib other than the default one of the clang toolchain, the clang compiler option --sysroot=<path> is used:
https://developer.arm.com/documentation/107976/22-1-0/Clang-reference/clang-command-line-options/--sysroot--path---clang-
With this option, clang will exclusively use the headers and libs defined by the <path> to build a project. However, due to the cmake process/creation done by CMSIS-Toolbox, CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES will be set with the default header/lib include path from the toolchain without considering the option --sysroot=<path> defined in the csolution/cpoject yml file, so that in this case an additional -isystem option with the default header/lib include path from the clang toolchain will be added during the compilation. This results in both/conflicted header/lib include paths (one default from the toolchain + one defined by --sysroot=<path>) are used during compilation.
We should find a proper solution for this use case.
Expected Behavior
When the clang compiler option --sysroot=<path> is used, only the <path> should be used/included during both cmake process/creation process and the final compilation process.
Affected tools
Affected operating systems
Is there an existing issue for this?
Current Behavior
In the use cases such as using llvm-libc as overlay C lib or explicitly using another C lib other than the default one of the clang toolchain, the clang compiler option
--sysroot=<path>is used:https://developer.arm.com/documentation/107976/22-1-0/Clang-reference/clang-command-line-options/--sysroot--path---clang-
With this option, clang will exclusively use the headers and libs defined by the
<path>to build a project. However, due to the cmake process/creation done by CMSIS-Toolbox,CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIESwill be set with the default header/lib include path from the toolchain without considering the option--sysroot=<path>defined in the csolution/cpoject yml file, so that in this case an additional -isystem option with the default header/lib include path from the clang toolchain will be added during the compilation. This results in both/conflicted header/lib include paths (one default from the toolchain + one defined by--sysroot=<path>) are used during compilation.We should find a proper solution for this use case.
Expected Behavior
When the clang compiler option
--sysroot=<path>is used, only the<path>should be used/included during both cmake process/creation process and the final compilation process.Affected tools
Affected operating systems