From c0df805ded79306368b7b2090314a01e699d20c6 Mon Sep 17 00:00:00 2001 From: suda-morris <362953310@qq.com> Date: Thu, 11 Apr 2019 12:47:44 +0800 Subject: [PATCH] make esp_wifi component depend on CONFIG_NO_BLOBS If CONFIG_NO_BLOBS is enabled, esp_wifi won't link wifi library. --- components/esp_wifi/CMakeLists.txt | 8 +++++--- components/esp_wifi/component.mk | 21 ++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index 433d20f726..457aad7297 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -9,13 +9,15 @@ set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_PRIV_INCLUDEDIRS) set(COMPONENT_REQUIRES) set(COMPONENT_PRIV_REQUIRES "wpa_supplicant" "nvs_flash") -set(COMPONENT_ADD_LDFRAGMENTS "linker.lf") + +if(NOT CONFIG_NO_BLOBS) + set(COMPONENT_ADD_LDFRAGMENTS "linker.lf") +endif() register_component() -target_link_libraries(${COMPONENT_TARGET} "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${IDF_TARGET}") - if(NOT CONFIG_NO_BLOBS) + target_link_libraries(${COMPONENT_TARGET} "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${IDF_TARGET}") target_link_libraries(${COMPONENT_TARGET} coexist core espnow mesh net80211 phy pp rtc smartconfig wpa2 wpa wps) endif() diff --git a/components/esp_wifi/component.mk b/components/esp_wifi/component.mk index 78c85270d4..a95dc1e967 100644 --- a/components/esp_wifi/component.mk +++ b/components/esp_wifi/component.mk @@ -5,17 +5,16 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_SRCDIRS := src -LIBS ?= ifndef CONFIG_NO_BLOBS -LIBS += core rtc net80211 pp wpa smartconfig coexist wps wpa2 espnow phy mesh + LIBS := core rtc net80211 pp wpa smartconfig coexist wps wpa2 espnow phy mesh + COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/lib_$(IDF_TARGET) \ + $(addprefix -l,$(LIBS)) + + COMPONENT_ADD_LDFRAGMENTS += linker.lf + + COMPONENT_SUBMODULES += lib_$(IDF_TARGET) + + ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib_$(IDF_TARGET)/lib%.a,$(LIBS)) + COMPONENT_ADD_LINKER_DEPS += $(ALL_LIB_FILES) endif -COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/lib_$(IDF_TARGET) \ - $(addprefix -l,$(LIBS)) \ - -COMPONENT_ADD_LDFRAGMENTS += linker.lf - -COMPONENT_SUBMODULES += lib_$(IDF_TARGET) - -ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib_$(IDF_TARGET)/lib%.a,$(LIBS)) -COMPONENT_ADD_LINKER_DEPS += $(ALL_LIB_FILES)