|
1 | | -get_directory_property(defined_defs COMPILE_DEFINITIONS) |
2 | | -message("Defined preprocessor variables-USER: ${defined_defs}") |
| 1 | +set(extra_component_path "$ENV{IDF_PATH}/examples/common_components/protocol_examples_common") |
3 | 2 |
|
4 | | -idf_component_register(SRC_DIRS "./src" |
5 | | - INCLUDE_DIRS "./include" |
6 | | - REQUIRES "sdmmc" "fatfs" "nvs_flash" "esp_wifi" "console" "esp_driver_i2c" "esp_netif" "unity") |
| 3 | + |
| 4 | +set(EXTRA_SRCS "${extra_component_path}/stdin_out.c" |
| 5 | + "${extra_component_path}/addr_from_stdin.c" |
| 6 | + "${extra_component_path}/connect.c" |
| 7 | + "${extra_component_path}/wifi_connect.c" |
| 8 | + "${extra_component_path}/protocol_examples_utils.c") |
| 9 | + |
| 10 | +if(CONFIG_EXAMPLE_PROVIDE_WIFI_CONSOLE_CMD) |
| 11 | + list(APPEND EXTRA_SRCS "${extra_component_path}/console_cmd.c") |
| 12 | +endif() |
| 13 | + |
| 14 | +if(CONFIG_EXAMPLE_CONNECT_ETHERNET) |
| 15 | + list(APPEND EXTRA_SRCS "${extra_component_path}/eth_connect.c") |
| 16 | +endif() |
| 17 | + |
| 18 | +if(CONFIG_EXAMPLE_CONNECT_THREAD) |
| 19 | + list(APPEND EXTRA_SRCS "${extra_component_path}/thread_connect.c") |
| 20 | +endif() |
| 21 | + |
| 22 | +if(CONFIG_EXAMPLE_CONNECT_PPP) |
| 23 | + list(APPEND EXTRA_SRCS "${extra_component_path}/ppp_connect.c") |
| 24 | +endif() |
| 25 | + |
| 26 | +file(GLOB_RECURSE APP_SRCS "src/*.c") |
| 27 | + |
| 28 | +idf_component_register( |
| 29 | + SRCS ${APP_SRCS} ${EXTRA_SRCS} |
| 30 | + INCLUDE_DIRS "include" "${extra_component_path}/include" |
| 31 | + REQUIRES "sdmmc" "fatfs" "nvs_flash" "esp_driver_i2c" "unity" |
| 32 | + PRIV_REQUIRES esp_netif esp_driver_gpio esp_driver_uart esp_wifi vfs console esp_eth openthread |
| 33 | +) |
| 34 | + |
| 35 | +if(CONFIG_EXAMPLE_PROVIDE_WIFI_CONSOLE_CMD) |
| 36 | + idf_component_optional_requires(PRIVATE console) |
| 37 | +endif() |
| 38 | + |
| 39 | +if(CONFIG_EXAMPLE_CONNECT_ETHERNET) |
| 40 | + idf_component_optional_requires(PUBLIC esp_eth) |
| 41 | +endif() |
| 42 | + |
| 43 | +if(CONFIG_EXAMPLE_CONNECT_THREAD) |
| 44 | + idf_component_optional_requires(PRIVATE openthread) |
| 45 | +endif() |
| 46 | + |
| 47 | +if(CONFIG_EXAMPLE_CONNECT_PPP) |
| 48 | + idf_component_optional_requires(PRIVATE esp_tinyusb espressif__esp_tinyusb) |
| 49 | +endif() |
0 commit comments