diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index 27021c9597..bc90727f40 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -33,15 +33,24 @@ endif() idf_build_get_property(build_dir BUILD_DIR) idf_build_get_property(python PYTHON) +set(gen_partition_table "${python}" "${CMAKE_CURRENT_SOURCE_DIR}/gen_esp32part.py" "-q" + "--offset" "${PARTITION_TABLE_OFFSET}" "${md5_opt}" "${flashsize_opt}" + "${partition_secure_opt}" ) + add_custom_command(OUTPUT "${build_dir}/partition_table/${unsigned_partition_bin}" - COMMAND "${python}" "${CMAKE_CURRENT_SOURCE_DIR}/gen_esp32part.py" - -q --offset ${PARTITION_TABLE_OFFSET} ${md5_opt} ${flashsize_opt} - ${partition_secure_opt} ${partition_csv} ${build_dir}/partition_table/${unsigned_partition_bin} + COMMAND ${gen_partition_table} "${partition_csv}" "${build_dir}/partition_table/${unsigned_partition_bin}" DEPENDS ${partition_csv} "${CMAKE_CURRENT_SOURCE_DIR}/gen_esp32part.py" VERBATIM) if(EXISTS ${partition_csv}) - add_custom_target(partition_table ALL DEPENDS "${build_dir}/partition_table/${final_partition_bin}") + add_custom_target(partition_table ALL + DEPENDS "${build_dir}/partition_table/${unsigned_partition_bin}" + "${build_dir}/partition_table/${final_partition_bin}" + COMMAND ${CMAKE_COMMAND} -E echo "Partition table binary generated. Contents:" + COMMAND ${CMAKE_COMMAND} -E echo "*******************************************************************************" + COMMAND ${gen_partition_table} "${build_dir}/partition_table/${unsigned_partition_bin}" + COMMAND ${CMAKE_COMMAND} -E echo "*******************************************************************************" + VERBATIM) else() # If the partition input CSV is not found, create a phony partition_table target that # fails the build. fail_at_build_time also touches CMakeCache.txt to cause a cmake run next time @@ -68,7 +77,7 @@ if(CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME) add_custom_command(TARGET partition_table POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "Partition table built but not signed. Sign partition data before flashing:" - COMMAND ${CMAKE_COMMAND} -E echo + COMMAND ${CMAKE_COMMAND} -E echo "\t${espsecurepy} sign_data --keyfile KEYFILE ${build_dir}/partition_table/${final_partition_bin}" VERBATIM) endif() diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 774d67b293..988bad67b7 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -447,6 +447,10 @@ function run_tests() (grep '"command"' build/compile_commands.json | grep -v mfix-esp32-psram-cache-issue) && failure "All commands in compile_commands.json should use PSRAM cache workaround" rm -r build + print_status "Displays partition table when executing target partition_table" + idf.py partition_table | grep -E "# Espressif .+ Partition Table" + rm -r build + print_status "Make sure a full build never runs '/usr/bin/env python' or similar" OLDPATH="$PATH" PYTHON="$(which python)"