9
9
idf_component_register(INCLUDE_DIRS include
10
10
SRCS ${src_wifi_is_remote}
11
11
${src_wifi_remote_eppp}
12
+ dummy_src.c # Prevents making this component potentially INTERFACE only
12
13
PRIV_INCLUDE_DIRS eppp
13
14
REQUIRES esp_event esp_netif
14
15
PRIV_REQUIRES esp_wifi esp-tls vfs)
@@ -27,8 +28,6 @@ endif()
27
28
28
29
idf_component_get_property(wifi esp_wifi COMPONENT_LIB)
29
30
30
- set (TARGET_INCLUDE_TYPE "INTERFACE" )
31
- set (TARGET_SOURCE_TYPE "INTERFACE" )
32
31
if (NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED)
33
32
set (src_wifi_with_remote ${IDF_VER_DIR} /esp_wifi_with_remote.c)
34
33
if (CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
@@ -37,25 +36,21 @@ if(NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED)
37
36
# We need to build wifi sources with wifi-remote properties, so the injected wifi headers are used
38
37
get_target_property (wifi_sources ${wifi} SOURCES )
39
38
set_target_properties (${wifi} PROPERTIES SOURCES "${CMAKE_CURRENT_SOURCE_DIR} /dummy_src.c" )
40
- set (TARGET_INCLUDE_TYPE "PUBLIC" )
41
- set (TARGET_SOURCE_TYPE "PRIVATE" )
42
39
endif ()
43
40
44
- if (CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP)
45
- set (TARGET_INCLUDE_TYPE "PUBLIC" )
46
- set (TARGET_SOURCE_TYPE "PRIVATE" )
47
- else ()
41
+ # Add weak symbol for the wifi_remote API if we're using esp_hosted implementation
42
+ if (CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED)
48
43
set (src_wifi_remote_weak ${IDF_VER_DIR} /esp_wifi_remote_weak.c)
49
44
if (CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
50
45
list (APPEND src_wifi_remote_weak ${IDF_VER_DIR} /esp_eap_client_remote_weak.c)
51
46
endif ()
52
47
endif ()
53
48
54
49
55
- target_include_directories (${COMPONENT_LIB} ${TARGET_INCLUDE_TYPE} ${IDF_VER_DIR} /include )
56
- target_sources (${COMPONENT_LIB} ${TARGET_SOURCE_TYPE} ${src_wifi_remote_weak}
57
- ${src_wifi_with_remote}
58
- ${wifi_sources} )
50
+ target_include_directories (${COMPONENT_LIB} PUBLIC ${IDF_VER_DIR} /include )
51
+ target_sources (${COMPONENT_LIB} PRIVATE ${src_wifi_remote_weak}
52
+ ${src_wifi_with_remote}
53
+ ${wifi_sources} )
59
54
60
55
if (NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED)
61
56
# Update wifi include directories to prepend the injected dir with modified headers supporting SLAVE capability
@@ -67,5 +62,5 @@ endif()
67
62
target_link_libraries (${wifi} PUBLIC ${COMPONENT_LIB} )
68
63
69
64
if (CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
70
- idf_component_optional_requires(${TARGET_INCLUDE_TYPE} wpa_supplicant)
65
+ idf_component_optional_requires(PRIVATE wpa_supplicant)
71
66
endif ()
0 commit comments