Skip to content

Commit 2c4e282

Browse files
committed
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
2 parents 6edf0fe + 1262254 commit 2c4e282

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)