Merge branch 'feature/use_prebuilt_util_for_wifi_component' into 'master'

esp_wifi: use prebuilt CMake util to add wifi libs

See merge request espressif/esp-idf!9574
This commit is contained in:
Angus Gratton 2020-07-14 07:57:11 +08:00
commit 2c4e2825ad

View File

@ -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()