Skip to content
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

Improve Zephyr SDK CMake with Zephyr. #683

Open
tejlmand opened this issue Jun 6, 2023 · 0 comments
Open

Improve Zephyr SDK CMake with Zephyr. #683

tejlmand opened this issue Jun 6, 2023 · 0 comments
Assignees
Milestone

Comments

@tejlmand
Copy link
Contributor

tejlmand commented Jun 6, 2023

Initial relocation of Zephyr CMAke toolchain code moved the CMake code into cmake/zephyr/generic.cmake and cmake/zephyr/target.cmake into Zephyr SDK here:
https://github.com/zephyrproject-rtos/sdk-ng/tree/main/cmake/zephyr

and then Zephyr loads this code here:
https://github.com/zephyrproject-rtos/zephyr/blob/c764c3423231ad42ec19e07f654517044a40ebfd/cmake/toolchain/zephyr/generic.cmake#L3
https://github.com/zephyrproject-rtos/zephyr/blob/c764c3423231ad42ec19e07f654517044a40ebfd/cmake/toolchain/zephyr/target.cmake#L3

this gives a hard coupling between the Zephyr SDK internal file structure layout and Zephyr itself, as well as making it harder to re-use portion of the Zephyr SDK, such as looking up tools from Zephyr SDK, without the desire for using the Zephyr SDK compiler.
For extra details, see: zephyrproject-rtos/zephyr#58329

Proposed improvement:
Update Zephyr SDK to provide functions, alternative specific set of ZEPHYR_SDK_-prefixed variables which caller (Zephyr build system) can then use to set internal toolchain variables.
This will provide a cleaner API which can be propoerly documented.

For backwards compatibility, Zephyr SDK can still provide generic.cmake and target.cmake which will map the new infrastructure to old style for older Zephyr SDK releases. (LTS releases is considered the important once)

Also, Zephyr SDK should not overwrite ZEPHYR_TOOLCHAIN_VARIANT in case it's already defined, as that makes re+use of Zephyr SDK provided tools harder to reuse with another compiler, ref: zephyrproject-rtos/zephyr#58329 (comment)

@tejlmand tejlmand self-assigned this Jun 6, 2023
@tejlmand tejlmand added this to the 0.17.0 milestone Jun 6, 2023
@stephanosio stephanosio modified the milestones: 0.17.0, 0.18.0 Sep 19, 2024
@stephanosio stephanosio modified the milestones: 0.18.0, 0.19.0 Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants