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-02-14 22:10:23 -05:00
|
|
|
"${original_driver_dir}/i2c/include/driver"
|
|
|
|
"${original_driver_dir}/spi/include/driver"
|
|
|
|
"${original_driver_dir}/gpio/include/driver"
|
2023-01-04 04:43:47 -05:00
|
|
|
"${original_driver_dir}/rmt/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"
|
|
|
|
"${original_driver_dir}/spi/include"
|
|
|
|
"${original_driver_dir}/gpio/include"
|
2023-01-04 04:43:47 -05:00
|
|
|
"${original_driver_dir}/rmt/include"
|
2023-04-01 22:45:04 -04:00
|
|
|
"${original_driver_dir}/usb_serial_jtag/include"
|
2023-02-14 22:10:23 -05:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../hal/include")
|
2021-01-13 23:11:22 -05:00
|
|
|
|
|
|
|
idf_component_mock(INCLUDE_DIRS ${include_dirs}
|
2021-07-21 00:07:53 -04:00
|
|
|
REQUIRES freertos
|
2021-01-13 23:11:22 -05:00
|
|
|
MOCK_HEADER_FILES
|
2023-02-14 22:10:23 -05:00
|
|
|
${original_driver_dir}/spi/include/driver/spi_master.h
|
|
|
|
${original_driver_dir}/spi/include/driver/spi_common.h
|
|
|
|
${original_driver_dir}/i2c/include/driver/i2c.h
|
2023-01-04 04:43:47 -05:00
|
|
|
${original_driver_dir}/gpio/include/driver/gpio.h
|
|
|
|
${original_driver_dir}/rmt/include/driver/rmt_rx.h
|
|
|
|
${original_driver_dir}/rmt/include/driver/rmt_tx.h
|
|
|
|
${original_driver_dir}/rmt/include/driver/rmt_common.h
|
2023-04-01 22:45:04 -04:00
|
|
|
${original_driver_dir}/rmt/include/driver/rmt_encoder.h
|
|
|
|
${original_driver_dir}/usb_serial_jtag/include/driver/usb_serial_jtag.h)
|
2022-12-02 01:54:27 -05:00
|
|
|
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PUBLIC SOC_I2C_NUM=2)
|