2021-01-13 23:11:22 -05:00
|
|
|
# NOTE: This kind of mocking currently works on Linux targets only.
|
|
|
|
# On Espressif chips, too many dependencies are missing at the moment.
|
2023-04-01 22:45:04 -04:00
|
|
|
message(STATUS "building DRIVER MOCKS (only SPI master, I2C, RMT, USB-serial and GPIO driver)")
|
2021-01-13 23:11:22 -05:00
|
|
|
|
|
|
|
idf_component_get_property(original_driver_dir driver COMPONENT_OVERRIDEN_DIR)
|
|
|
|
|
|
|
|
set(include_dirs
|
2023-10-17 00:11:42 -04:00
|
|
|
"${IDF_PATH}/components/esp_driver_gpio/include/driver"
|
|
|
|
"${IDF_PATH}/components/esp_driver_gpio/include"
|
2023-10-19 02:38:32 -04:00
|
|
|
"${IDF_PATH}/components/esp_driver_spi/include/driver"
|
|
|
|
"${IDF_PATH}/components/esp_driver_spi/include"
|
2023-11-21 21:22:29 -05:00
|
|
|
"${IDF_PATH}/components/esp_driver_rmt/include/driver"
|
|
|
|
"${IDF_PATH}/components/esp_driver_rmt/include"
|
2023-02-14 22:10:23 -05:00
|
|
|
"${original_driver_dir}/i2c/include/driver"
|
2023-04-01 22:45:04 -04:00
|
|
|
"${original_driver_dir}/usb_serial_jtag/include/driver"
|
2023-02-14 22:10:23 -05:00
|
|
|
"${original_driver_dir}/i2c/include"
|
2023-11-09 22:49:23 -05:00
|
|
|
"${original_driver_dir}/usb_serial_jtag/include")
|
2021-01-13 23:11:22 -05:00
|
|
|
|
2023-11-09 22:49:23 -05:00
|
|
|
# Note: "hal" and "soc" are only required for corresponding header files and their definitions
|
|
|
|
# here, they don't provide functionality when built for running on the host.
|
2021-01-13 23:11:22 -05:00
|
|
|
idf_component_mock(INCLUDE_DIRS ${include_dirs}
|
2023-11-09 22:49:23 -05:00
|
|
|
REQUIRES freertos hal soc
|
2021-01-13 23:11:22 -05:00
|
|
|
MOCK_HEADER_FILES
|
2023-10-17 00:11:42 -04:00
|
|
|
${IDF_PATH}/components/esp_driver_gpio/include/driver/gpio.h
|
2023-10-19 02:38:32 -04:00
|
|
|
${IDF_PATH}/components/esp_driver_spi/include/driver/spi_master.h
|
|
|
|
${IDF_PATH}/components/esp_driver_spi/include/driver/spi_common.h
|
2023-11-21 21:22:29 -05:00
|
|
|
${IDF_PATH}/components/esp_driver_rmt/include/driver/rmt_rx.h
|
|
|
|
${IDF_PATH}/components/esp_driver_rmt/include/driver/rmt_tx.h
|
|
|
|
${IDF_PATH}/components/esp_driver_rmt/include/driver/rmt_common.h
|
|
|
|
${IDF_PATH}/components/esp_driver_rmt/include/driver/rmt_encoder.h
|
2023-02-14 22:10:23 -05:00
|
|
|
${original_driver_dir}/i2c/include/driver/i2c.h
|
2023-04-01 22:45:04 -04:00
|
|
|
${original_driver_dir}/usb_serial_jtag/include/driver/usb_serial_jtag.h)
|