8000 esp32/esp32_common.cmake: Allow overriding linker.lf. · sparkfun/micropython@cbd21b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit cbd21b3

Browse files
karlpdpgeorge
authored andcommitted
esp32/esp32_common.cmake: Allow overriding linker.lf.
Particularly for out of tree builds, one may need to provide alternative or extra linker fragment files, or specify an absolute path to the default `linker.lf` file. In the default case, do nothing, provide a plain `linker.lf`, as before. Signed-off-by: Karl Palsson <karl.palsson@marel.com>
1 parent ec876a5 commit cbd21b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ports/esp32/esp32_common.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ list(APPEND IDF_COMPONENTS
178178
vfs
179179
)
180180

181+
# Provide the default LD fragment if not set
182+
if (MICROPY_USER_LDFRAGMENTS)
183+
set(MICROPY_LDFRAGMENTS ${MICROPY_USER_LDFRAGMENTS})
184+
else()
185+
set(MICROPY_LDFRAGMENTS linker.lf)
186+
endif()
187+
181188
# Register the main IDF component.
182189
idf_component_register(
183190
SRCS
@@ -197,7 +204,7 @@ idf_component_register(
197204
${MICROPY_BOARD_DIR}
198205
${CMAKE_BINARY_DIR}
199206
LDFRAGMENTS
200-
linker.lf
207+
${MICROPY_LDFRAGMENTS}
201208
REQUIRES
202209
${IDF_COMPONENTS}
203210
)

0 commit comments

Comments
 (0)
0