|
@@ -654,7 +654,7 @@ Take care when adding configuration values in this file, as they will be include
|
|
|
|
|
|
|
|
``project_include.cmake`` files are used inside ESP-IDF, for defining project-wide build features such as ``esptool.py`` command line arguments and the ``bootloader`` "special app".
|
|
``project_include.cmake`` files are used inside ESP-IDF, for defining project-wide build features such as ``esptool.py`` command line arguments and the ``bootloader`` "special app".
|
|
|
|
|
|
|
|
-Wrappers to redefine or extend existing functions
|
|
|
|
|
|
|
+Wrappers to Redefine or Extend Existing Functions
|
|
|
-------------------------------------------------
|
|
-------------------------------------------------
|
|
|
|
|
|
|
|
Thanks to the linker's wrap feature, it is possible to redefine or extend the behavior of an existing ESP-IDF function. To do so, you will need to provide the following CMake declaration in your project's ``CMakeLists.txt`` file:
|
|
Thanks to the linker's wrap feature, it is possible to redefine or extend the behavior of an existing ESP-IDF function. To do so, you will need to provide the following CMake declaration in your project's ``CMakeLists.txt`` file:
|
|
@@ -663,11 +663,11 @@ Thanks to the linker's wrap feature, it is possible to redefine or extend the be
|
|
|
|
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=function_to_redefine")
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=function_to_redefine")
|
|
|
|
|
|
|
|
-Where ``function_to_redefine`` is the name of the function to redefine or extend. This option will let the linker replace all the calls to ``function_to_redefine`` functions in the binary libraries be changed to calls to ``__wrap_function_to_redefine`` function. Thus, you must define this new symbol in your application.
|
|
|
|
|
|
|
+Where ``function_to_redefine`` is the name of the function to redefine or extend. This option will let the linker replace all the calls to ``function_to_redefine`` functions in the binary libraries with calls to ``__wrap_function_to_redefine`` function. Thus, you must define this new symbol in your application.
|
|
|
|
|
|
|
|
The linker will provide a new symbol named ``__real_function_to_redefine`` which points to the former implementation of the function to redefine. It can be called from the new implementation, making it an extension of the former one.
|
|
The linker will provide a new symbol named ``__real_function_to_redefine`` which points to the former implementation of the function to redefine. It can be called from the new implementation, making it an extension of the former one.
|
|
|
|
|
|
|
|
-This mechanism is shown in the example :example:`build_system/wrappers`. Check its ``README.md`` for more details.
|
|
|
|
|
|
|
+This mechanism is shown in the example :example:`build_system/wrappers`. Check :idf_file:`examples/build_system/wrappers/README.md` for more details.
|
|
|
|
|
|
|
|
.. _config_only_component:
|
|
.. _config_only_component:
|
|
|
|
|
|