-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[Question] Why does not zephyr use a toolchain file with cmake as -DCMAKE_TOOLCHAIN_FILE=.. ? #23387
Comments
One of the requirements when we transitioned from make/Kbuild to CMake was to be able to do something like:
and everything should magically work. Now that west is so pervasive we could reconsider this. |
In my experience it couples the sdk harder into the project using it more than necessary. A bit of the same error Nordic made with their mesh sdk, though zephyr has implemented it in a much nicer way. Zephyr seems to be nicely laid out to be able make this change as everything is built as libs and linked in to a final product. |
When migrating to CMake, we were competing against a CLI that looked like: make To be competitive, we could not require users to specify the toolchain file on every CMake invocation. Note that west did not exist at the time. |
I don't see @trondhe requesting us to remove this feature. |
Yes and no I guess. If however supporting both ways plays out well both in as interface for users and maintainability, then that is of course a good option. |
IMO we should reconsider this and add support for toolchain files, IMO this is orthogonal to west and should be kept orthogonal to west. Integration with toolchains that already support CMAKE and integration with IDEs that expect a toolchain file makes this necessary. Ease of use with support toolchains and zephyr SDK is a nice thing, but we cant expect every toolchain to be added the same into Zephyr... |
A prototype that proves that supporting toolchain files will make integration easier is welcome. But until proven otherwise I am sceptical and would not recommend investing time into this. |
The question of why we don't use a toolchain file is answered. |
What is the status on this? Are there any plans to support |
No |
I just wondered why Zephyr does not use CMake's recommended way of cross-compiling by calling it with a toolchain file on the command line as
but instead just use an include statement at the top of the project?
What is the motivation and arguments for/against doing it this way?
The text was updated successfully, but these errors were encountered: