From 7db5c3ffd1752cec3d1677a5b195777024f3a2e4 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Tue, 18 Feb 2020 08:22:43 +0500 Subject: [PATCH 1/3] partition_table: output partition table info for partition_table target --- components/partition_table/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index 443a5ad6e..4f34a2f1f 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -43,7 +43,13 @@ if(CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES) endif() if(EXISTS ${partition_csv}) - add_custom_target(partition_table ALL DEPENDS "${final_partition_bin}") + add_custom_target(partition_table ALL DEPENDS "${final_partition_bin}" + COMMAND ${CMAKE_COMMAND} -E echo "Partition table binary generated. Contents:" + COMMAND ${CMAKE_COMMAND} -E echo "*******************************************************************************" + COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/gen_esp32part.py" -q --offset + ${PARTITION_TABLE_OFFSET} ${md5_opt} ${flashsize_opt} "${unsigned_partition_bin}" + COMMAND ${CMAKE_COMMAND} -E echo "*******************************************************************************" + VERBATIM) else() # This is a bit of a hack: If the partition input CSV is not found, create a phony partition_table target that # fails the build. Have it also touch CMakeCache.txt to cause a cmake run next time From 797eff65347ed7c601eb3accc3f807454665d2e8 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Thu, 5 Mar 2020 11:04:01 +0800 Subject: [PATCH 2/3] ci: add test for partition_table target --- tools/ci/test_build_system_cmake.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 4c83a3e48..4d0275330 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -223,6 +223,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" mv sdkconfig.bak sdkconfig + 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)" From 9bae06ef108468daafa6f566f592804abef5b83b Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Tue, 27 Aug 2019 09:24:17 +0800 Subject: [PATCH 3/3] cmake: fix build failure when git repo is initialized but no first commit Closes https://github.com/espressif/esp-idf/issues/3920 --- .../third_party/GetGitRevisionDescription.cmake.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/cmake/third_party/GetGitRevisionDescription.cmake.in b/tools/cmake/third_party/GetGitRevisionDescription.cmake.in index 6d8b708ef..0cf025b14 100644 --- a/tools/cmake/third_party/GetGitRevisionDescription.cmake.in +++ b/tools/cmake/third_party/GetGitRevisionDescription.cmake.in @@ -24,10 +24,12 @@ if(HEAD_CONTENTS MATCHES "ref") if(EXISTS "@GIT_DIR@/${HEAD_REF}") configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) else() - configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) - file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) - if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") - set(HEAD_HASH "${CMAKE_MATCH_1}") + if(EXISTS "@GIT_DIR@/packed-refs") + configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) + file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) + if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") + set(HEAD_HASH "${CMAKE_MATCH_1}") + endif() endif() endif() else()