From 4352265fa0beeb5b8e2a975770891d31966d6e60 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 8 Nov 2019 11:56:13 +0800 Subject: [PATCH 1/2] cmake: Fix case error passing extra CMake args to sub-projects Bug in commit f4ea7c5a where the wrong variable case was used when passing through to sub-projects --- components/bootloader/project_include.cmake | 2 +- components/ulp/project_include.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/bootloader/project_include.cmake b/components/bootloader/project_include.cmake index dffa4b963..157ec3bb6 100644 --- a/components/bootloader/project_include.cmake +++ b/components/bootloader/project_include.cmake @@ -110,7 +110,7 @@ externalproject_add(bootloader # the bootloader common component requirements depends on this and # config variables are not available before project() call. -DLEGACY_INCLUDE_COMMON_HEADERS=${CONFIG_LEGACY_INCLUDE_COMMON_HEADERS} - ${EXTRA_CMAKE_ARGS} + ${extra_cmake_args} INSTALL_COMMAND "" BUILD_ALWAYS 1 # no easy way around this... BUILD_BYPRODUCTS ${bootloader_binary_files} diff --git a/components/ulp/project_include.cmake b/components/ulp/project_include.cmake index da4431336..e33ea2d50 100644 --- a/components/ulp/project_include.cmake +++ b/components/ulp/project_include.cmake @@ -48,7 +48,7 @@ function(ulp_embed_binary app_name s_sources exp_dep_srcs) -DIDF_PATH=${idf_path} -DSDKCONFIG=${SDKCONFIG_HEADER} -DPYTHON=${python} - ${EXTRA_CMAKE_ARGS} + ${extra_cmake_args} BUILD_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/${app_name} --target build BUILD_BYPRODUCTS ${ulp_artifacts} ${ulp_artifacts_extras} ${ulp_ps_sources} ${CMAKE_CURRENT_BINARY_DIR}/${app_name}/${app_name} @@ -68,4 +68,4 @@ function(ulp_embed_binary app_name s_sources exp_dep_srcs) target_linker_script(${COMPONENT_LIB} INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/${app_name}/${app_name}.ld) target_add_binary_data(${COMPONENT_LIB} ${CMAKE_CURRENT_BINARY_DIR}/${app_name}/${app_name}.bin BINARY) endif() -endfunction() \ No newline at end of file +endfunction() From 6f761dd62d49751d050327b642dd276280ff8a95 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 8 Nov 2019 12:50:28 +0800 Subject: [PATCH 2/2] cmake: Fix some uninitialized variable warnings --- components/bootloader/project_include.cmake | 5 +++++ components/lwip/CMakeLists.txt | 2 +- components/mbedtls/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/bootloader/project_include.cmake b/components/bootloader/project_include.cmake index 157ec3bb6..003a2b0b6 100644 --- a/components/bootloader/project_include.cmake +++ b/components/bootloader/project_include.cmake @@ -67,6 +67,7 @@ if(CONFIG_SECURE_SIGNED_APPS) set(SECURE_BOOT_SIGNING_KEY ${secure_boot_signing_key}) # needed by some other components set(sign_key_arg "-DSECURE_BOOT_SIGNING_KEY=${secure_boot_signing_key}") + set(ver_key_arg) add_dependencies(gen_secure_boot_keys gen_secure_boot_signing_key) else() @@ -87,10 +88,14 @@ if(CONFIG_SECURE_SIGNED_APPS) add_custom_target(gen_secure_boot_verification_key) endif() + set(sign_key_arg) set(ver_key_arg "-DSECURE_BOOT_VERIFICATION_KEY=${secure_boot_verification_key}") add_dependencies(gen_secure_boot_keys gen_secure_boot_verification_key) endif() +else() + set(sign_key_arg) + set(ver_key_arg) endif() idf_build_get_property(idf_path IDF_PATH) diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt index 7d346127f..56187ca63 100644 --- a/components/lwip/CMakeLists.txt +++ b/components/lwip/CMakeLists.txt @@ -134,7 +134,7 @@ idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "${include_dirs}" LDFRAGMENTS linker.lf REQUIRES vfs esp_wifi - PRIV_REQUIRES ${priv_requires} esp_eth tcpip_adapter nvs_flash) + PRIV_REQUIRES esp_eth tcpip_adapter nvs_flash) # lots of LWIP source files evaluate macros that check address of stack variables target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-address) diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index 0c4c263fe..a46a6b6f0 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -2,7 +2,7 @@ idf_build_get_property(idf_target IDF_TARGET) idf_component_register(INCLUDE_DIRS "port/include" "mbedtls/include" REQUIRES lwip - PRIV_REQUIRES ${IDF_COMPONENT_REQUIRES_COMMON} soc + PRIV_REQUIRES soc ) # Only build mbedtls libraries