Skip to content

Commit 1262254

Browse files
committed
esp_wifi: use prebuilt CMake util to add wifi libs
1 parent 4e8ae03 commit 1262254

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

components/esp_wifi/CMakeLists.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,12 @@ if(link_binary_libs)
4141
set(blobs coexist core espnow mesh net80211 pp rtc smartconfig ${phy})
4242

4343
foreach(blob ${blobs})
44-
add_library(${blob} STATIC IMPORTED)
45-
set_property(TARGET ${blob} PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}/lib${blob}.a)
44+
add_prebuilt_library(${blob} "${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}/lib${blob}.a"
45+
REQUIRES ${COMPONENT_NAME})
46+
set(blob_reqs ${blobs})
47+
list(REMOVE_ITEM blob_reqs ${blob}) # remove itself from requirements
48+
set_property(TARGET ${blob} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${blob_reqs})
4649
target_link_libraries(${COMPONENT_LIB} PUBLIC ${blob})
47-
48-
foreach(_blob ${blobs})
49-
if(NOT _blob STREQUAL ${blob})
50-
set_property(TARGET ${blob} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${_blob})
51-
endif()
52-
endforeach()
53-
54-
set_property(TARGET ${blob} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${COMPONENT_LIB})
5550
endforeach()
5651
endif()
5752

0 commit comments

Comments
 (0)