-
Notifications
You must be signed in to change notification settings - Fork 3k
CMake: Allow providing a custom toolchain file #14446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@boraozgen This issue has an incomplete or old issue template.For future reference please use an up to date clone of the repository before raising issues. Many thanks. |
Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. |
We can use
Is it expected to do -DCMAKE_ASM_COMPILER=path ? |
I don't understand your proposition. Let me clarify my point. In my opinion, What do you mean by PS: Another use case that occured to me: You use multiple toolchain versions and want to build the same project with them. Adding the toolchain to PATH isn't an option for such an development environment. |
The user can also provide those in their main CMakeLists.txt. If not provided, a warning could be emitted and the default could be set. This way it works as before but lets user customize those. I'm not sure about the
@boraozgen can you tell me more about that? what IDE do you use? How did you set it up? With VSCode and CMake Tools, it's not possible to have two toolchains live side by side for the same project :( |
I use vscode + cmake-tools. cmake-tools has the option to change the toolchains (called kits in the tool). It currently does not work with Mbed as it overrides this variable. You can PM me in the forums for further discussion. |
👍 I've got what I was looking for. We will triage and fix. it should be provided via -D, not being in CMakelists.txt |
This also might apply to other toolchain related stuff like compiler options. How about a possibility for the user to supply an optional toolchain file, and using the current GCC_ARM file by default? |
That is the idea. if |
Exactly. Apparently that conditional is already there: Lines 12 to 16 in 96e19af
There are two issues with the current state:
|
#14385 - MBED_PATH removal issue Can you create an issue for 2nd? |
I edited the issue title to reflect the updated info. #14385 refers to only |
OK, I'll link here the proposal from Rob: ARMmbed/mbed-tools#225 (this should be tracking issue for section "Improve toolchain handling" |
Previously mentioned here: ARMmbed/mbed-tools#153
The following lines force CMake to use the toolchain from PATH.
mbed-os/tools/cmake/toolchains/GCC_ARM.cmake
Lines 4 to 7 in c734138
This should instead be provided by the user (IDEs like VSCode and CLion do this). Otherwise it leads to configuration issues when using multiple toolchains in the same project. I have such a use case, where I build another target to run my GUI library on the host.
Is there a case against removing these lines?
GCC_ELF2BIN
could then be derived from the provided compiler location.The text was updated successfully, but these errors were encountered: