Can't tell linker to exclude stripping several functions
Posted: Thu Jun 04, 2020 10:17 am
Hello,
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 :
and this works as expected, no more "undefined reference".
Now, if I want to add several functions, I do something like this :
This does not work because, CMake, generates this command line :
While it should be
How should I do?
Thanks
Julien
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