From 36cd75d7ed13742a0dbefbc88660297b8336d87e Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 28 Oct 2019 10:32:59 +1100 Subject: [PATCH] spi_flash tests: Fix exclusion of new API tests in legacy mode --- components/spi_flash/test/CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/components/spi_flash/test/CMakeLists.txt b/components/spi_flash/test/CMakeLists.txt index 5da97b3674..3980437baf 100644 --- a/components/spi_flash/test/CMakeLists.txt +++ b/components/spi_flash/test/CMakeLists.txt @@ -1,11 +1,15 @@ set(src_dirs ".") +set(exclude_srcs) + if(IDF_TARGET STREQUAL "esp32") list(APPEND src_dirs "esp32") + if(CONFIG_SPI_FLASH_USE_LEGACY_IMPL) + set(exclude_srcs "esp32/test_esp_flash.c" "esp32/test_partition_ext.c") + endif() endif() -idf_component_register(SRC_DIRS ${src_dirs} - INCLUDE_DIRS "." - REQUIRES unity test_utils spi_flash bootloader_support app_update) -if(CONFIG_SPI_FLASH_USE_LEGACY_IMPL) - set(COMPONENT_SRCEXCLUDE "test_esp_flash.c" "test_partition_ext.c") -endif() +idf_component_register(SRC_DIRS ${src_dirs} + EXCLUDE_SRCS ${exclude_srcs} + INCLUDE_DIRS "." + REQUIRES unity test_utils spi_flash bootloader_support app_update) +