-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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: enhanced board entry file handling #67322
cmake: enhanced board entry file handling #67322
Conversation
@tejlmand you may want to look at LLVM being sad, some tests are timing out, unclear to me why |
9ebc9d6
to
c7fb3a1
Compare
cmake/modules/extensions.cmake
Outdated
# The full order of build strings returned in the list will be: | ||
# - Full build string, including identifier revision, build type | ||
# - Build string with build type removed | ||
# - Build string with revision removed in addition | ||
# - Build string with board variants removed in addition | ||
# - Build string with cpuset removed in addition | ||
# - Build string with soc removed in addition |
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.
Based on this description, I tried:
zephyr_build_string(build_string BOARD alpha BOARD_REVISION 1.0.0 BOARD_IDENTIFIER /soc/bar BUILD foo MERGE)
# I expected: alpha_soc_bar_1_0_0_foo;alpha_soc_bar_1_0_0;alpha_soc_bar;alpha_soc;alpha
# but I got: alpha_soc_bar_1_0_0_foo;alpha_soc_bar;alpha
It works if I streamline the implementation like this:
string(REPLACE "/" ";" build_str_segments "${BUILD_STR_BOARD}${BUILD_STR_BOARD_IDENTIFIER}")
if(DEFINED BUILD_STR_BOARD_REVISION)
string(REPLACE "." "_" revision_string ${BUILD_STR_BOARD_REVISION})
list(APPEND build_str_segments ${revision_string})
endif()
list(APPEND build_str_segments ${BUILD_STR_BUILD})
while(NOT build_str_segments STREQUAL "")
list(JOIN build_str_segments "_" variant_string)
list(APPEND ${outvar} "${variant_string}")
list(POP_BACK build_str_segments)
if(NOT BUILD_STR_MERGE)
break()
endif()
endwhile()
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.
Nice catch 👍
And thanks for the proposal, using JOIN
sure is cleaner.
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.
fixed, resorted to use string(JOIN ...)
as that allows for BUILD_STR_BUILD
at end, so that all build strings are appended with that info when passed as argument.
That conforms to what we do today with build string, and it was an oversight in first round that it was only appended to first string.
Function description updated as well.
c7fb3a1
to
932ea75
Compare
932ea75
to
7823ecf
Compare
With a single board now covering what used to be several boards, and with the ability to omit SoC when building for a single SoC board, then <board>_defconfig and <board>.dts lookup is improved. A single SoC board may prefer to keep its defconfig entry point as <board>_defconfig instead of <board>_<soc>_defconfig. Also, a multi-SoC board / multi-core SoC board, which used to be implemented as n-boards may wish to have common _defconfig settings in a common <board>_defconfig file, and the SoC / cpuset specifics in <board>_<soc>_defconfig / <board>_<soc>_<core>_defconfig. Such defconfig support allows also to place build variant specifics in its own <board>_<soc>_<variant>_defconfig file. This commit allows multiple _defconfigs for a board and its identifiers. Similar is implemented for a board's dts file. If a <board>_<soc>_<core>.dts file is not found, the build system will instead use <board>_<soc>.dts, and finally fallback to <board>.dts. This allows a board to have a shared dts file for all board identifiers which are identical while still support specific dts where required. A dts file is a devicetree starting point and thus two dts files cannot be used in together. For such cases, an ordinary board overlay file must be used. Signed-off-by: Torsten Rasmussen <[email protected]>
7823ecf
to
a9aa96c
Compare
compliance failure is related to out-of-date MAINTAINERS file for soc and board entries. |
408201d
into
zephyrproject-rtos:collab-hwm
With a single board now covering what used to be several boards, and with the ability to omit SoC when building for a single SoC board, then
<board>_defconfig
and<board>.dts
lookup is improved.A single SoC board may prefer to keep its defconfig entry point as
<board>_defconfig
instead of<board>_<soc>_defconfig
.Also, a multi-SoC board / multi-core SoC board, which used to be implemented as n-boards may wish to have common
_defconfig
settings in a common<board>_defconfig
file, and the SoC / cpuset specifics in<board>_<soc>_defconfig
/<board>_<soc>_<core>_defconfig
.Such defconfig support allows also to place build variant specifics in its own
<board>_<soc>_<variant>_defconfig
file.This commit allows multiple
_defconfigs
for a board and its identifiers.Similar is implemented for a board's dts file.
If a
<board>_<soc>_<core>.dts
file is not found, the build system will instead use<board>_<soc>.dts
, and finally fallback to<board>.dts
.This allows a board to have a shared dts file for all board identifiers which are identical while still support specific dts where required.
A dts file is a devicetree starting point and thus two dts files cannot be used in together. For such cases, an ordinary board overlay file must be used.