I have several components in my project. Some of them are using functions from others.
In order to avoid compiler to strip the functions that are not used by the main component, I use the -u option like this:
main's CMakeLists.txt :
Code: Select all
<snip>
target_link_options(
${COMPONENT_LIB}
PUBLIC
-u SpiInOut
)
Now, if I want to add several functions, I do something like this :
Code: Select all
target_link_options(
${COMPONENT_LIB}
PUBLIC
-u SpiInOut
-u memcpy1
)
Code: Select all
<snip> -u SpiInOut memcpy1
Code: Select all
<snip> -u SpiInOut -u memcpy1
Thanks
Julien