forked from espressif/esp-idf
feat(wifi): avoid compiling components related to wifi when wifi is not supported
This commit is contained in:
@@ -4,6 +4,20 @@ if(${idf_target} STREQUAL "linux")
|
|||||||
return() # This component is not supported by the POSIX/Linux simulator
|
return() # This component is not supported by the POSIX/Linux simulator
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if( NOT CONFIG_ESP_WIFI_ENABLED AND NOT CMAKE_BUILD_EARLY_EXPANSION )
|
||||||
|
# No local wifi: provide only netif bindings
|
||||||
|
set(srcs
|
||||||
|
"src/wifi_default.c"
|
||||||
|
"src/wifi_netif.c"
|
||||||
|
"src/wifi_default_ap.c")
|
||||||
|
|
||||||
|
# This component provides "esp_wifi" "wifi_apps" headers if WiFi not enabled
|
||||||
|
# (implementation supported optionally in a managed component esp_wifi_remote)
|
||||||
|
idf_component_register(SRCS "${srcs}"
|
||||||
|
INCLUDE_DIRS "include" "wifi_apps/include")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CONFIG_ESP_WIFI_ENABLED)
|
if(CONFIG_ESP_WIFI_ENABLED)
|
||||||
|
|
||||||
if(CONFIG_APP_NO_BLOBS)
|
if(CONFIG_APP_NO_BLOBS)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
menu "Wi-Fi"
|
menu "Wi-Fi"
|
||||||
# TODO: Disable WIFI support on ESP32-H2 (WIFI-5796)
|
|
||||||
# visible if SOC_WIFI_SUPPORTED
|
visible if SOC_WIFI_SUPPORTED
|
||||||
|
|
||||||
config ESP_WIFI_ENABLED
|
config ESP_WIFI_ENABLED
|
||||||
bool
|
bool
|
||||||
|
@@ -4,6 +4,13 @@ if(${target} STREQUAL "linux")
|
|||||||
return() # This component is not supported by the POSIX/Linux simulator
|
return() # This component is not supported by the POSIX/Linux simulator
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if( NOT CONFIG_ESP_WIFI_ENABLED AND NOT CMAKE_BUILD_EARLY_EXPANSION )
|
||||||
|
# This component provides only "esp_provisioning" headers if WiFi not enabled
|
||||||
|
# (implementation supported optionally in a managed component esp_wifi_remote)
|
||||||
|
idf_component_register(INCLUDE_DIRS include)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(srcs "src/wifi_config.c"
|
set(srcs "src/wifi_config.c"
|
||||||
"src/wifi_scan.c"
|
"src/wifi_scan.c"
|
||||||
"src/wifi_ctrl.c"
|
"src/wifi_ctrl.c"
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
menu "Wi-Fi Provisioning Manager"
|
menu "Wi-Fi Provisioning Manager"
|
||||||
|
|
||||||
|
visible if SOC_WIFI_SUPPORTED
|
||||||
|
|
||||||
config WIFI_PROV_SCAN_MAX_ENTRIES
|
config WIFI_PROV_SCAN_MAX_ENTRIES
|
||||||
int "Max Wi-Fi Scan Result Entries"
|
int "Max Wi-Fi Scan Result Entries"
|
||||||
default 16
|
default 16
|
||||||
|
@@ -6,6 +6,15 @@ else()
|
|||||||
set(linker_fragments linker.lf)
|
set(linker_fragments linker.lf)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if( NOT CONFIG_ESP_WIFI_ENABLED
|
||||||
|
AND NOT CONFIG_ESP_HOST_WIFI_ENABLED
|
||||||
|
AND NOT CMAKE_BUILD_EARLY_EXPANSION )
|
||||||
|
# This component provides only "esp_supplicant" headers if WiFi not enabled
|
||||||
|
# (implementation supported optionally in a managed component esp_wifi_remote)
|
||||||
|
idf_component_register(INCLUDE_DIRS include port/include esp_supplicant/include)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(srcs "port/os_xtensa.c"
|
set(srcs "port/os_xtensa.c"
|
||||||
"port/eloop.c"
|
"port/eloop.c"
|
||||||
"src/ap/ap_config.c"
|
"src/ap/ap_config.c"
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
idf_component_register(SRCS "cmd_wifi.c"
|
if(CONFIG_ESP_WIFI_ENABLED)
|
||||||
|
set(srcs "cmd_wifi.c")
|
||||||
|
else()
|
||||||
|
set(srcs)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS .
|
INCLUDE_DIRS .
|
||||||
REQUIRES console esp_wifi)
|
REQUIRES console esp_wifi)
|
||||||
|
@@ -168,7 +168,7 @@ void app_main(void)
|
|||||||
esp_console_register_help_command();
|
esp_console_register_help_command();
|
||||||
register_system_common();
|
register_system_common();
|
||||||
register_system_sleep();
|
register_system_sleep();
|
||||||
#if SOC_WIFI_SUPPORTED
|
#if CONFIG_ESP_WIFI_ENABLED
|
||||||
register_wifi();
|
register_wifi();
|
||||||
#endif
|
#endif
|
||||||
register_nvs();
|
register_nvs();
|
||||||
|
@@ -92,7 +92,7 @@ void app_main(void)
|
|||||||
esp_console_register_help_command();
|
esp_console_register_help_command();
|
||||||
register_system_common();
|
register_system_common();
|
||||||
register_system_sleep();
|
register_system_sleep();
|
||||||
#if SOC_WIFI_SUPPORTED
|
#if CONFIG_ESP_WIFI_ENABLED
|
||||||
register_wifi();
|
register_wifi();
|
||||||
#endif
|
#endif
|
||||||
register_nvs();
|
register_nvs();
|
||||||
|
Reference in New Issue
Block a user