Skip to content

Commit ff70a91

Browse files
projectgusdpgeorge
authored andcommitted
esp32: Move the linker wrap options out of the project CMakeLists.
For in-tree builds, these are effectively equivalent. However for out-of-tree builds it's preferable to have as little as possible in the top-level CMakeLists.txt file (as the out-of-tree build needs its own copy). This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
1 parent 4601dcb commit ff70a91

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ports/esp32/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,5 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
7171
# Set the ___location of the main component for the project (one per target).
7272
list(APPEND EXTRA_COMPONENT_DIRS main_${IDF_TARGET})
7373

74-
# Enable the panic handler wrapper
75-
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=esp_panic_handler" APPEND)
76-
77-
# Patch LWIP memory pool allocators (see lwip_patch.c)
78-
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=memp_malloc" APPEND)
79-
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=memp_free" APPEND)
80-
8174
# Define the project.
8275
project(micropython)

ports/esp32/esp32_common.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,13 @@ target_include_directories(${MICROPY_TARGET} PUBLIC
236236
target_link_libraries(${MICROPY_TARGET} micropy_extmod_btree)
237237
target_link_libraries(${MICROPY_TARGET} usermod)
238238

239+
# Enable the panic handler wrapper
240+
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=esp_panic_handler" APPEND)
241+
242+
# Patch LWIP memory pool allocators (see lwip_patch.c)
243+
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=memp_malloc" APPEND)
244+
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=memp_free" APPEND)
245+
239246
# Collect all of the include directories and compile definitions for the IDF components,
240247
# including those added by the IDF Component Manager via idf_components.yaml.
241248
foreach(comp ${__COMPONENT_NAMES_RESOLVED})

0 commit comments

Comments
 (0)