mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
6dfac0dd68
A section in the documentation has also been added to talk about the wrap feature of the linker.
10 lines
710 B
CMake
10 lines
710 B
CMake
# For this component, contraty to the bootloader's one, we don't need the WHOLE_ARCHIVE option.
|
|
# This is due to the fact that this source file, app_wrapper.c, contains a strong symbol that is required by the linker
|
|
# in order to generate the final binary: `app_main`. Thus, the whole app_wrapper object file, including the wrapper
|
|
# it contains, will be included inside the application binary.
|
|
idf_component_register(SRCS "app_wrapper.c")
|
|
|
|
# Tell the linker that we want to redefine the function named `esp_restart`.
|
|
# We must now define a function named __wrap_esp_restart, which has the same signature as the former implementation.
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=esp_restart")
|