From 598246d287c07c6afb3a8340b043db6f9b697255 Mon Sep 17 00:00:00 2001 From: Omar Chebib Date: Thu, 6 Jan 2022 15:09:48 +0800 Subject: [PATCH] CI: idf_as_lib is now run on all suported targets --- examples/build_system/cmake/idf_as_lib/build.sh | 3 +++ tools/ci/test_build_system_cmake.sh | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/examples/build_system/cmake/idf_as_lib/build.sh b/examples/build_system/cmake/idf_as_lib/build.sh index b1c533f810..9a18dc76db 100755 --- a/examples/build_system/cmake/idf_as_lib/build.sh +++ b/examples/build_system/cmake/idf_as_lib/build.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +set -euo pipefail +PARAM="" + # Retrive the target from the current filename, if no target specified, # the variable will be empty TARGET=$(echo $0 | cut -s -f2 -d- | cut -s -f1 -d.) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 91f5c8c844..a4dc1fe2f9 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -502,6 +502,19 @@ function run_tests() popd rm -r $IDF_PATH/examples/build_system/cmake/idf_as_lib/build + print_status "Test build ESP-IDF as a library to a custom CMake projects for all targets" + IDF_AS_LIB=$IDF_PATH/examples/build_system/cmake/idf_as_lib + # note: we just need to run cmake + for TARGET in "esp32" "esp32s2" "esp32s3" "esp32c3" "esp32h2" "esp8684" + do + echo "Build idf_as_lib for $TARGET target" + rm -rf build + mkdir -p build && cd build + cmake $IDF_AS_LIB -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-$TARGET.cmake -DTARGET=$TARGET || failure "Failed to generate idf_as_lib build files for target $TARGET" + cmake --build . || failure "Failed to build idf_as_lib for target $TARGET" + cd .. + done + print_status "Building a project with CMake library imported and PSRAM workaround, all files compile with workaround" # Test for libraries compiled within ESP-IDF rm -r build sdkconfig