CMakeLists.txt 929 B

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