@@ -3,83 +3,82 @@ if(CONFIG_ESP_HOSTED_ENABLED)
33 set (FG_root_dir "." )
44 set (host_dir "${FG_root_dir} /host" )
55
6- set (COMPONENT_SRCS "${host_dir} /esp_hosted_host_init.c" "${host_dir} /api/src/esp_wifi_weak.c" "${host_dir} /api/src/esp_hosted_api.c" "${host_dir} /drivers/transport/transport_drv.c" "${host_dir} /drivers/serial/serial_ll_if.c" "${host_dir} /utils/common.c" "${host_dir} /utils/util.c" "${host_dir} /utils/stats.c" "${host_dir} /drivers/serial/serial_drv.c" )
6+ set (srcs "${host_dir} /esp_hosted_host_init.c" "${host_dir} /api/src/esp_wifi_weak.c" "${host_dir} /api/src/esp_hosted_api.c" "${host_dir} /drivers/transport/transport_drv.c" "${host_dir} /drivers/serial/serial_ll_if.c" "${host_dir} /utils/common.c" "${host_dir} /utils/util.c" "${host_dir} /utils/stats.c" "${host_dir} /drivers/serial/serial_drv.c" )
77
88 # only these directories are public. Others are private
9- set (COMPONENT_ADD_PUBLIC_INCLUDEDIRS "${host_dir} " "${host_dir} /api/include" )
9+ set (pub_include "${host_dir} " "${host_dir} /api/include" )
1010
11- set (COMPONENT_ADD_INCLUDEDIRS "${host_dir} /drivers/transport" "${host_dir} /drivers/transport/spi" "${host_dir} /drivers/transport/sdio" "${host_dir} /drivers/serial" "${host_dir} /utils" )
11+ set (priv_include "${host_dir} /drivers/transport" "${host_dir} /drivers/transport/spi" "${host_dir} /drivers/transport/sdio" "${host_dir} /drivers/serial" "${host_dir} /utils" " ${host_dir} /api/priv " )
1212
1313 # rpc files - wrap -> slaveif -> core
1414 set (rpc_dir "${host_dir} /drivers/rpc" )
1515 set (rpc_core_dir "${rpc_dir} /core" )
1616 set (rpc_slaveif_dir "${rpc_dir} /slaveif" )
1717 set (rpc_wrap_dir "${rpc_dir} /wrap" )
18- list (APPEND COMPONENT_SRCS "${rpc_core_dir} /rpc_core.c" "${rpc_core_dir} /rpc_req.c" "${rpc_core_dir} /rpc_rsp.c" "${rpc_core_dir} /rpc_evt.c"
18+ list (APPEND srcs "${rpc_core_dir} /rpc_core.c" "${rpc_core_dir} /rpc_req.c" "${rpc_core_dir} /rpc_rsp.c" "${rpc_core_dir} /rpc_evt.c"
1919 "${rpc_slaveif_dir} /rpc_slave_if.c"
2020 "${rpc_wrap_dir} /rpc_wrap.c" )
21- list (APPEND COMPONENT_ADD_INCLUDEDIRS "${rpc_core_dir} " "${rpc_slaveif_dir} " "${rpc_wrap_dir} " )
21+ list (APPEND priv_include "${rpc_core_dir} " "${rpc_slaveif_dir} " "${rpc_wrap_dir} " )
2222
2323 # virtual serial
2424 set (virt_serial_dir "${host_dir} /drivers/virtual_serial_if" )
25- list (APPEND COMPONENT_SRCS "${virt_serial_dir} /serial_if.c" )
26- list (APPEND COMPONENT_ADD_INCLUDEDIRS "${virt_serial_dir} " )
25+ list (APPEND srcs "${virt_serial_dir} /serial_if.c" )
26+ list (APPEND priv_include "${virt_serial_dir} " )
2727
2828 # mempool
29- list (APPEND COMPONENT_SRCS "${host_dir} /drivers/mempool/mempool.c" )
30- list (APPEND COMPONENT_ADD_INCLUDEDIRS "${host_dir} /drivers/mempool" )
29+ list (APPEND srcs "${host_dir} /drivers/mempool/mempool.c" )
30+ list (APPEND priv_include "${host_dir} /drivers/mempool" )
3131
3232 # slave and host common files
3333 set (common_dir "${FG_root_dir} /common" )
34- list (APPEND COMPONENT_SRCS "${common_dir} /protobuf-c/protobuf-c/protobuf-c.c" "${common_dir} /proto/esp_hosted_rpc.pb-c.c" )
35- list (APPEND COMPONENT_ADD_INCLUDEDIRS "${common_dir} " "${common_dir} /log" "${common_dir} /rpc" "${common_dir} /transport" "${common_dir} /protobuf-c" "${common_dir} /proto" )
34+ list (APPEND srcs "${common_dir} /protobuf-c/protobuf-c/protobuf-c.c" "${common_dir} /proto/esp_hosted_rpc.pb-c.c" )
35+ list (APPEND priv_include "${common_dir} " "${common_dir} /log" "${common_dir} /rpc" "${common_dir} /transport" "${common_dir} /protobuf-c" "${common_dir} /proto" )
3636
3737 # host ESP32 specific files
38- list (APPEND COMPONENT_SRCS "${host_dir} /port/esp/freertos/src/esp_hosted_ota.c" )
38+ list (APPEND srcs "${host_dir} /port/esp/freertos/src/esp_hosted_ota.c" )
3939
4040 # bt (NimBLE)
4141 ### TODO config for HCI over UART
42- list (APPEND COMPONENT_ADD_INCLUDEDIRS "${host_dir} /drivers/bt" )
42+ list (APPEND priv_include "${host_dir} /drivers/bt" )
4343 if (CONFIG_ESP_HOSTED_NIMBLE_HCI_VHCI OR CONFIG_ESP_HOSTED_BLUEDROID_HCI_VHCI)
44- list (APPEND COMPONENT_SRCS "${host_dir} /drivers/bt/vhci_drv.c" )
44+ list (APPEND srcs "${host_dir} /drivers/bt/vhci_drv.c" )
4545 else ()
46- list (APPEND COMPONENT_SRCS "${host_dir} /drivers/bt/hci_stub_drv.c" )
46+ list (APPEND srcs "${host_dir} /drivers/bt/hci_stub_drv.c" )
4747 endif ()
4848
4949 # transport files
5050 if (CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE)
51- list (APPEND COMPONENT_SRCS "${host_dir} /drivers/transport/sdio/sdio_drv.c" )
51+ list (APPEND srcs "${host_dir} /drivers/transport/sdio/sdio_drv.c" )
5252 elseif (CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE)
53- list (APPEND COMPONENT_SRCS "${host_dir} /drivers/transport/spi_hd/spi_hd_drv.c" )
53+ list (APPEND srcs "${host_dir} /drivers/transport/spi_hd/spi_hd_drv.c" )
5454 elseif (CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE)
55- list (APPEND COMPONENT_SRCS "${host_dir} /drivers/transport/spi/spi_drv.c" )
55+ list (APPEND srcs "${host_dir} /drivers/transport/spi/spi_drv.c" )
5656 elseif (CONFIG_ESP_HOSTED_UART_HOST_INTERFACE)
57- list (APPEND COMPONENT_SRCS "${host_dir} /drivers/transport/uart/uart_drv.c" )
57+ list (APPEND srcs "${host_dir} /drivers/transport/uart/uart_drv.c" )
5858 endif ()
5959
6060 # config files
61- list (APPEND COMPONENT_ADD_INCLUDEDIRS "${host_dir} /port/esp/freertos/include" )
62- list (APPEND COMPONENT_SRCS "${host_dir} /port/esp/freertos/src/esp_hosted_config.c" "${host_dir} /port/esp/freertos/src/esp_hosted_transport_config.c" )
61+ list (APPEND priv_include "${host_dir} /port/esp/freertos/include" )
62+ list (APPEND srcs "${host_dir} /port/esp/freertos/src/esp_hosted_config.c" "${host_dir} /port/esp/freertos/src/esp_hosted_transport_config.c" )
6363
6464 # transport port files
65- list (APPEND COMPONENT_SRCS "${host_dir} /port/esp/freertos/src/os_wrapper.c" )
65+ list (APPEND srcs "${host_dir} /port/esp/freertos/src/os_wrapper.c" )
6666 if (CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE)
67- list (APPEND COMPONENT_SRCS "${host_dir} /port/esp/freertos/src/sdio_wrapper.c" )
67+ list (APPEND srcs "${host_dir} /port/esp/freertos/src/sdio_wrapper.c" )
6868 elseif (CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE)
69- list (APPEND COMPONENT_SRCS "${host_dir} /port/esp/freertos/src/spi_hd_wrapper.c" )
69+ list (APPEND srcs "${host_dir} /port/esp/freertos/src/spi_hd_wrapper.c" )
7070 elseif (CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE)
71- list (APPEND COMPONENT_SRCS "${host_dir} /port/esp/freertos/src/spi_wrapper.c" )
71+ list (APPEND srcs "${host_dir} /port/esp/freertos/src/spi_wrapper.c" )
7272 elseif (CONFIG_ESP_HOSTED_UART_HOST_INTERFACE)
73- list (APPEND COMPONENT_SRCS "${host_dir} /port/esp/freertos/src/uart_wrapper.c" )
73+ list (APPEND srcs "${host_dir} /port/esp/freertos/src/uart_wrapper.c" )
7474 endif ()
7575
7676endif ()
7777
78- idf_component_register(SRCS ${COMPONENT_SRCS }
78+ idf_component_register(SRCS ${srcs }
7979 PRIV_REQUIRES soc esp_event esp_netif esp_timer driver esp_wifi bt esp_http_client
80- EXCLUDE_SRCS ${EXCLUDE_COMPONENT_SRCS}
81- INCLUDE_DIRS ${COMPONENT_ADD_PUBLIC_INCLUDEDIRS}
82- PRIV_INCLUDE_DIRS ${COMPONENT_ADD_INCLUDEDIRS} )
80+ INCLUDE_DIRS ${pub_include}
81+ PRIV_INCLUDE_DIRS ${priv_include} )
8382
8483idf_component_set_property(${COMPONENT_NAME} WHOLE_ARCHIVE TRUE )
8584
0 commit comments