feat(factory): auto-sync latest bins after idf build

This commit is contained in:
admin
2026-03-02 13:44:56 +08:00
parent 5cd0c51be0
commit 673b257c4f
5 changed files with 169 additions and 8 deletions

View File

@@ -1,3 +1,25 @@
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(TQ_printer)
# Auto-sync required firmware bins to tools/esptool-factory/bin after IDF build.
set(_factory_sync_python "")
if(DEFINED PYTHON AND NOT "${PYTHON}" STREQUAL "")
set(_factory_sync_python "${PYTHON}")
elseif(DEFINED _Python3_EXECUTABLE AND NOT "${_Python3_EXECUTABLE}" STREQUAL "")
set(_factory_sync_python "${_Python3_EXECUTABLE}")
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter)
set(_factory_sync_python "${Python3_EXECUTABLE}")
endif()
add_custom_target(factory_sync_bins ALL
COMMAND ${_factory_sync_python}
${CMAKE_SOURCE_DIR}/tools/esptool-factory/sync_factory_bins.py
--build-dir
${CMAKE_BINARY_DIR}
DEPENDS app bootloader
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Sync firmware bins to tools/esptool-factory/bin"
VERBATIM
)