esp-idf/mocks/driver/CMakeLists.txt
Jakob Hasse 79b0256d63 [driver]: partial mocking of driver component
* added mocking of spi master and gpio
* mock registering in one function in
  component.cmake
2021-06-24 10:10:29 +08:00

23 lines
952 B
CMake

# NOTE: This kind of mocking currently works on Linux targets only.
# On Espressif chips, too many dependencies are missing at the moment.
# Furthermore, this component can only mock the interfaces of
# spi_master.h and gpio.h.
message(STATUS "building DRIVER MOCKS (only SPI and GPIO driver)")
idf_component_get_property(original_driver_dir driver COMPONENT_OVERRIDEN_DIR)
set(include_dirs
"${original_driver_dir}/include"
"${original_driver_dir}/include/driver"
"${CMAKE_CURRENT_SOURCE_DIR}/../freertos/include"
"${CMAKE_CURRENT_SOURCE_DIR}/../hal/include"
"${CMAKE_CURRENT_SOURCE_DIR}/../esp_hw_support/include")
idf_component_mock(INCLUDE_DIRS ${include_dirs}
MOCK_HEADER_FILES
${original_driver_dir}/include/driver/spi_master.h
${original_driver_dir}/include/driver/spi_common.h
${original_driver_dir}/include/driver/gpio.h)
idf_build_set_property(COMPILE_DEFINITIONS "-DSPI_MOCK" APPEND)