Merge branch 'bugfix/cmake_bugfixes_v3.1' into 'release/v3.1'

CMake-related bugfixes (v3.1)

See merge request espressif/esp-idf!8071
This commit is contained in:
Angus Gratton 2020-03-26 16:27:34 +08:00
commit 94e2981d17
3 changed files with 17 additions and 5 deletions

View file

@ -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

View file

@ -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)"

View file

@ -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()