-
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: Show executable for memory report #66217
cmake: Show executable for memory report #66217
Conversation
Hello @hellesvik-nordic, and thank you very much for your first pull request to the Zephyr project! |
17d67cc
to
55ac863
Compare
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.
instead of yet another way of doing what is already done, then please update this line instead to provide full path:
Line 1891 in b8856ae
COMMENT "Generating files from ${KERNEL_ELF_NAME} for board: ${BOARD}" |
Note, a small detail regarding COMMENT, make
will always print all comments, but ninja will not due to the way the ninja generator works on post build commands.
So the COMMENT
should be changed into an echo COMMAND to give desired behavior on using both make
and ninja
.
55ac863
to
d2c096c
Compare
Good point, as you say it should already be printed, I just did not see it as I just west(and therefore ninja) to build.
|
you can actually use |
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.
Thanks for this nice improvement.
But let's move the echo command up.
CMakeLists.txt
Outdated
${post_build_commands} | ||
BYPRODUCTS | ||
${post_build_byproducts} | ||
COMMENT "Generating files from ${KERNEL_ELF_NAME} for board: ${BOARD}" | ||
COMMAND ${CMAKE_COMMAND} -E echo "Generating files from ${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME} for board: ${BOARD}" |
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.
minor nit, if you move the COMMAND up so it's the first echo command, then it's printed first before other post build commands.
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Generating files from ${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME} for board: ${BOARD}"
${post_build_commands}
BYPRODUCTS
${post_build_byproducts}
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.
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.
Somehow the memory report is still printed first:
Because the memory report is printed by the linker when using gcc, and is not a postbuild command.
It will only help in relation to other postbuild commands, such as image.py
😉
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.
I see
Moved it up now
d2c096c
to
9ba3613
Compare
Firstly, COMMENT does not work for ninja. Therefore, change COMMENT to echo. With the addition of sysbuild, several memory reports can be printed for one build. Because of this, it is useful to know which executable each memory report is printed for, so adding full path to elf file. Signed-off-by: Sigurd Hellesvik <sigurd.hellesvik@nordicsemi.no>
9ba3613
to
0fbd456
Compare
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.
Thanks a lot for the effort 👍
Hi @hellesvik-nordic! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
With the addition of sysbuild, several memory reports can be printed for one build.
Because of this, it is useful to know which executable each memory report is printed for.