mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
esptool_py: add missing phony build targets for CMake
Adds targets erase_flash and monitor for users not using idf.py. Closes https://github.com/espressif/esp-idf/issues/2420.
This commit is contained in:
@@ -138,13 +138,34 @@ function(esptool_py_custom_target target_name flasher_filename dependencies)
|
||||
-D IDF_PATH="${idf_path}"
|
||||
-D ESPTOOLPY="${ESPTOOLPY}"
|
||||
-D ESPTOOL_ARGS="write_flash;@flash_${flasher_filename}_args"
|
||||
-D ESPTOOL_WORKING_DIR="${build_dir}"
|
||||
-D WORKING_DIRECTORY="${build_dir}"
|
||||
-P run_esptool.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
USES_TERMINAL
|
||||
)
|
||||
endfunction()
|
||||
|
||||
add_custom_target(erase_flash
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D IDF_PATH="${idf_path}"
|
||||
-D ESPTOOLPY="${ESPTOOLPY}"
|
||||
-D ESPTOOL_ARGS="erase_flash"
|
||||
-P run_esptool.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
add_custom_target(monitor
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D IDF_PATH="${idf_path}"
|
||||
-D IDF_MONITOR="${idf_path}/tools/idf_monitor.py"
|
||||
-D ELF_FILE="${elf}"
|
||||
-D WORKING_DIRECTORY="${build_dir}"
|
||||
-P run_idf_monitor.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
esptool_py_custom_target(flash project "app;partition_table;bootloader")
|
||||
esptool_py_custom_target(app-flash app "app")
|
||||
|
||||
|
Reference in New Issue
Block a user