CMakeLists.txt 739 B

1234567891011121314151617181920212223242526
  1. set(lib_dir ${build_dir}/esp-idf)
  2. if(IDF_TARGET STREQUAL esp32)
  3. set(driver esp32/i2s.c esp32/i2s_hal.c esp32/spi_bus_lock.c)
  4. else()
  5. return()
  6. endif()
  7. string(REPLACE ".c" ".c.obj" driver_obj "${driver}")
  8. idf_component_register( SRCS ${driver}
  9. REQUIRES driver
  10. INCLUDE_DIRS ${IDF_PATH}/components/driver
  11. PRIV_INCLUDE_DIRS ${IDF_PATH}/components/driver/include/driver
  12. )
  13. # CMake is just a pile of crap
  14. message(STATUS "!! overriding ${driver} !!")
  15. message(STATUS "CAREFUL, LIBRARIES STRIPPING FROM DUPLICATED COMPONENTS DEPENDS ON THIS BEING REBUILD")
  16. add_custom_command(
  17. TARGET ${COMPONENT_LIB}
  18. PRE_LINK
  19. COMMAND xtensa-esp32-elf-ar -d ${lib_dir}/driver/libdriver.a ${driver_obj}
  20. VERBATIM
  21. )