From 126225421ee4977abd5e8dca937505e49e43b2a2 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Fri, 10 Jul 2020 14:20:25 +0800 Subject: [PATCH] esp_wifi: use prebuilt CMake util to add wifi libs --- components/esp_wifi/CMakeLists.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index f2416a9c51..ee3ce89634 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -41,17 +41,12 @@ if(link_binary_libs) set(blobs coexist core espnow mesh net80211 pp rtc smartconfig ${phy}) foreach(blob ${blobs}) - add_library(${blob} STATIC IMPORTED) - set_property(TARGET ${blob} PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}/lib${blob}.a) + add_prebuilt_library(${blob} "${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}/lib${blob}.a" + REQUIRES ${COMPONENT_NAME}) + set(blob_reqs ${blobs}) + list(REMOVE_ITEM blob_reqs ${blob}) # remove itself from requirements + set_property(TARGET ${blob} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${blob_reqs}) target_link_libraries(${COMPONENT_LIB} PUBLIC ${blob}) - - foreach(_blob ${blobs}) - if(NOT _blob STREQUAL ${blob}) - set_property(TARGET ${blob} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${_blob}) - endif() - endforeach() - - set_property(TARGET ${blob} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${COMPONENT_LIB}) endforeach() endif()