1# NOTE: This kind of mocking currently works on Linux targets only.
2#       On Espressif chips, too many dependencies are missing at the moment.
3#       Furthermore, this component can only mock the interfaces of
4#       spi_master.h and gpio.h.
5message(STATUS "building DRIVER MOCKS (only SPI and GPIO driver)")
6
7idf_component_get_property(original_driver_dir driver COMPONENT_OVERRIDEN_DIR)
8
9set(include_dirs
10    "${original_driver_dir}/include"
11    "${original_driver_dir}/include/driver"
12    "${CMAKE_CURRENT_SOURCE_DIR}/../hal/include"
13    "${CMAKE_CURRENT_SOURCE_DIR}/../esp_hw_support/include")
14
15idf_component_mock(INCLUDE_DIRS ${include_dirs}
16    REQUIRES freertos
17    MOCK_HEADER_FILES
18    ${original_driver_dir}/include/driver/spi_master.h
19    ${original_driver_dir}/include/driver/spi_common.h
20    ${original_driver_dir}/include/driver/gpio.h)
21
22idf_build_set_property(COMPILE_DEFINITIONS "-DSPI_MOCK" APPEND)
23