mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-02 22:51:14 +00:00
cmake: Fix "make flash" & "ninja flash" targets
As reported on forum. Requires a small CMake wrapper script to pick up environment variables at flashing time.
This commit is contained in:

committed by
Angus Gratton

parent
8f665c3393
commit
cfb96e67f9
@@ -43,9 +43,14 @@ add_custom_target(app ALL DEPENDS "${PROJECT_NAME}.bin")
|
||||
#
|
||||
function(esptool_py_custom_target target_name flasher_filename dependencies)
|
||||
add_custom_target(${target_name} DEPENDS ${dependencies}
|
||||
COMMAND ${ESPTOOLPY} -p ${CONFIG_ESPTOOLPY_PORT} -b ${CONFIG_ESPTOOLPY_BAUD}
|
||||
write_flash @flash_${flasher_filename}_args
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D IDF_PATH="${IDF_PATH}"
|
||||
-D ESPTOOLPY="${ESPTOOLPY}"
|
||||
-D ESPTOOL_ARGS="write_flash;@flash_${flasher_filename}_args"
|
||||
-D ESPTOOL_WORKING_DIR="${CMAKE_CURRENT_BINARY_DIR}"
|
||||
-P run_esptool.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
USES_TERMINAL
|
||||
)
|
||||
endfunction()
|
||||
|
||||
|
Reference in New Issue
Block a user