-
Notifications
You must be signed in to change notification settings - Fork 931
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
Generate map files if pico_add_extra_outputs
is called
#432
Generate map files if pico_add_extra_outputs
is called
#432
Conversation
Many examples in pico-examples call `pico_add_extra_outputs` with the comment "# create map/bin/hex file etc.", so it seems like this is the intention.
Is the map file not currently already created even without calling |
At least on my machine the map file is generated if and only if I add this line. |
On a Raspberry Pi 4, with pico-sdk v1.1.2 installed and
builds all examples and creates all the appropriate output files, including the Running the following command from the build directory after building the examples:
displays the following:
As can be seen, all the How can the issue that this PR fixes be reproduced? |
I will try to reproduce from a fresh repo. But in that case, which part of the CMake code actually sets the linker flag that causes the map files to be made? The only place I can see is pico_add_map_output, and I don't see that being called on the targets. |
The call to |
Yes, the comments are incorrect. Ideally all these would be created by default, however the UF2, DIS and BIN are created from the final executable target, and I'm not aware of any ways to do this automatically (i.e. no sort of method call) in CMake short of implementing a new compiler type. The map file is generated by the linker, so can be added as a per target setting. |
I did the exercise from #432 (comment) with both the master and develop branches of the SDK and with both nmake and ninja, and in all cases I see the map files are generated. So whatever the issue is it seems that I've caused it myself. Sorry for the confusion. One curious difference between nmake and ninja is that nmake places the map files in the same directory as the elf, while ninja places all the map files at the top level of the build folder. 🤷
I suppose a new function could be added: function(pico_add_executable target)
add_executable(${target} ${ARGN})
pico_add_extra_outputs(${target})
endfunction() |
Yeah, perhaps worth doing; had considered it in the past, but was trying to avoid requiring something other than The issue was really did I want to change all the examples to use |
Interesting, i hadn't noticed... perhaps including |
closing this; feel free to open a new PR either for fixing the comments, or adding a new method |
Many examples in the pico-examples repo call
pico_add_extra_outputs
with the comment "create map/bin/hex file etc.", so it seems like this is the intention.