From 0f6308d69cec66818ccd0e69cf54a96af091ba72 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Mon, 4 May 2020 20:56:40 +0800 Subject: [PATCH 1/3] ci: test idf_build_process defaults set properly --- tools/ci/test_build_system_cmake.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 45825a6d9..c2a0f7d41 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -730,6 +730,20 @@ endmenu\n" >> ${IDF_PATH}/Kconfig test -f build/flasher_args.json && failure "flasher_args.json should not be generated in a loadable ELF build" idf.py build || failure "Couldn't build a loadable ELF file" + print_status "Defaults set properly for unspecified idf_build_process args" + pushd . + cd $IDF_PATH/examples/build_system/cmake/idf_as_lib + cp CMakeLists.txt CMakeLists.txt.bak + echo -e "\nidf_build_get_property(project_dir PROJECT_DIR)" >> CMakeLists.txt + echo -e "\nmessage(\"Project directory: \${project_dir}\")" >> CMakeLists.txt + mkdir build && cd build + cmake .. -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32.cmake -DTARGET=esp32 &> log.txt + grep "Project directory: $IDF_PATH/examples/build_system/cmake/idf_as_lib" log.txt || failure "PROJECT_DIR default was not set" + cd .. + mv CMakeLists.txt.bak CMakeLists.txt + rm -rf build + popd + print_status "All tests completed" if [ -n "${FAILURES}" ]; then echo "Some failures were detected:" From 740819529b49de100379fadcba41209fd090443a Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Wed, 29 Apr 2020 14:07:23 +0800 Subject: [PATCH 2/3] cmake: fix setting defaults in idf_build_process Closes https://github.com/espressif/esp-idf/issues/5053 --- tools/cmake/build.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index d7b91e34f..803130028 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -314,7 +314,7 @@ endmacro() # macro(__build_set_default var default) set(_var __${var}) - if(NOT "${_var}" STREQUAL "") + if(NOT "${${_var}}" STREQUAL "") idf_build_set_property(${var} "${${_var}}") else() idf_build_set_property(${var} "${default}") From 13cd832b0c533cc13175982d72ab15d7cf5cc5a1 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Thu, 14 May 2020 16:26:52 +0800 Subject: [PATCH 3/3] ci: pushd and cd in one go in idf_build_process defaults test --- tools/ci/test_build_system_cmake.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index c2a0f7d41..ef2ee5ce4 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -731,8 +731,7 @@ endmenu\n" >> ${IDF_PATH}/Kconfig idf.py build || failure "Couldn't build a loadable ELF file" print_status "Defaults set properly for unspecified idf_build_process args" - pushd . - cd $IDF_PATH/examples/build_system/cmake/idf_as_lib + pushd $IDF_PATH/examples/build_system/cmake/idf_as_lib cp CMakeLists.txt CMakeLists.txt.bak echo -e "\nidf_build_get_property(project_dir PROJECT_DIR)" >> CMakeLists.txt echo -e "\nmessage(\"Project directory: \${project_dir}\")" >> CMakeLists.txt