]> granicus.if.org Git - esp-idf/commitdiff
esp32, mbedtls: check component name when enabling test flags
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 19 Nov 2018 16:49:38 +0000 (00:49 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 19 Nov 2018 17:27:24 +0000 (01:27 +0800)
Otherwise flags get enabled even when building tests for other components.

components/esp32/CMakeLists.txt
components/esp32/Makefile.projbuild
components/mbedtls/CMakeLists.txt
components/mbedtls/Makefile.projbuild

index 880278508e3344694655bc4f767eecaa53010d2d..ae69d7575a4566b7d7802832a94e052b46292498 100644 (file)
@@ -158,7 +158,7 @@ else()
     endif()
 
     # Enable dynamic esp_timer overflow value if building unit tests
-    if(NOT "${BUILD_TEST_COMPONENTS}" EQUAL "")
+    if(esp32_test IN_LIST BUILD_TEST_COMPONENTS)
         add_definitions(-DESP_TIMER_DYNAMIC_OVERFLOW_VAL)
     endif()
 endif()
index a17591ff01249ba6803ba71e2e9c2094b2322722..5f819ae8adf4cbd3829c87910aaba3e6a557e774 100644 (file)
@@ -39,7 +39,7 @@ CXXFLAGS+=-mfix-esp32-psram-cache-issue
 endif
 
 # Enable dynamic esp_timer overflow value if building unit tests 
-ifneq ("$(TEST_COMPONENTS_LIST)","")
+ifneq ("$(filter esp32,$(TEST_COMPONENTS_LIST))","")
 CPPFLAGS += -DESP_TIMER_DYNAMIC_OVERFLOW_VAL
 endif
 ESP32_LINKER_SCRIPT_TEMPLATE := $(COMPONENT_PATH)/ld/esp32.common.ld.in
index ab4185ede10523d508072f7adb6791a555e15754..cb8ba60855d8c4e73ce559c3fa64af3b6942945b 100644 (file)
@@ -94,3 +94,8 @@ register_component()
 target_compile_definitions(mbedtls PUBLIC
     -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"
 )
+
+# Catch usage of deprecated mbedTLS functions when building tests
+if(mbedtls_test IN_LIST BUILD_TEST_COMPONENTS)
+    add_definitions(-DMBEDTLS_DEPRECATED_WARNING)
+endif()
index cf49f9a1d58a3fcbe9a3e97a287c794ffa316d7f..9bfba169388c4392e54631e78af40e0a6ea09b76 100644 (file)
@@ -3,6 +3,6 @@
 CPPFLAGS += -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"'
 
 # Catch usage of deprecated mbedTLS functions when building tests
-ifneq ("$(TEST_COMPONENTS_LIST)","")
+ifneq ("$(filter mbedtls,$(TEST_COMPONENTS_LIST))","")
 CPPFLAGS += -DMBEDTLS_DEPRECATED_WARNING
 endif