-
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
cmake: package_helper CMake script #41302
cmake: package_helper CMake script #41302
Conversation
944ae90
to
3c3c3d0
Compare
3c3c3d0
to
14f8391
Compare
14f8391
to
3fa7b06
Compare
cd0aae1
to
1849402
Compare
be58359
to
abdcd6d
Compare
cmake/package_tooling.cmake
Outdated
# | ||
# Copyright (c) 2021, Nordic Semiconductor ASA | ||
|
||
# The Zephyr package tooling script provides a generic script mode interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about package_helper
?
abdcd6d
to
8751a0f
Compare
cmake/modules/zephyr_default.cmake
Outdated
endforeach() | ||
|
||
if(NOT DEFINED SUB_COMPONENTS) | ||
include(kernel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we unconditionally include kernel?
If SUB_COMPONENTS is defined the program will have returned before now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point.
after the cleanup, this if can be removed.
will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
1467560
to
9423439
Compare
This commit allows to load only subcomponents of the default Zephyr CMake module, zephyr_default.cmake. This allows other tools to execute Zephyr CMake build system up to a specific module and the stop further processing. This commit is an enabler for future support in twister to process only devicetree or kconfig, to allow test / sample filtering before generating a complete build system. Sub-components can be loaded as: > find_package(Zephyr COMPONENTS zephyr_default:<sub-component>) for example: > find_package(Zephyr COMPONENTS zephyr_default:dts) Signed-off-by: Torsten Rasmussen <[email protected]>
The Zephyr CMake package helper script allows to invoke Zephyr package modules as they are invoked at configure time, up to the modules given with `-DMODULES=<modules>`. This allows to run the configure time part of the Zephyr build system without generating a complete build system. This means that for example devicetree module can be invoked for a given sample and board to generate zephyr.dts identical to what is created by the build system during a build. To generate zephyr.dts for hello_world, invoke the script as: $ cmake -DBOARD=<board> -B build -S samples/hello_world \ $ -DMODULES=dts -P <ZEPHYR_BASE>/cmake/package_helper.cmake Other modules, for example 'kconfig' and 'zephyr_modules' can also be invoked this way. This will allow other tools, such as twister, to executed only a subset of the build system like dts in order to do filtering before determine if a complete build should be invoked. Signed-off-by: Torsten Rasmussen <[email protected]>
9423439
to
f75862c
Compare
Re-based, @mbolivar-nordic @SebastianBoe please re-approve. |
The Zephyr CMake package helper script allows to invoke Zephyr package
modules as they are invoked at configure time, up to the modules given
with
-DMODULES=<modules>
.This allows to run the configure time part of the Zephyr build system
without generating a complete build system.
This means that for example devicetree module can be invoked for a given
sample and board to generate zephyr.dts identical to what is created
by the build system during a build.
To generate zephyr.dts for hello_world, invoke the script as:
$ cmake -DBOARD= -B build -S samples/hello_world
$ -DMODULES=dts -P <ZEPHYR_BASE>/cmake/package_helper.cmake
Other modules, for example 'kconfig' and 'zephyr_modules' can also be
invoked this way.
This will allow other tools, such as twister, to executed only a
subset of the build system like dts in order to do filtering before
determine if a complete build should be invoked.
Signed-off-by: Torsten Rasmussen [email protected]
NOTE Ignore first commit, it's a squash of #41301.