CMakeLists.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. idf_build_get_property(target IDF_TARGET)
  2. idf_component_register(SRCS "src/cpu_util.c"
  3. "src/memory_layout_utils.c"
  4. "src/lldesc.c"
  5. "src/hal/cpu_hal.c"
  6. "src/hal/rmt_hal.c"
  7. "src/hal/rtc_io_hal.c"
  8. "src/hal/dac_hal.c"
  9. "src/hal/adc_hal.c"
  10. "src/hal/spi_hal.c"
  11. "src/hal/spi_hal_iram.c"
  12. "src/hal/spi_slave_hal.c"
  13. "src/hal/spi_slave_hal_iram.c"
  14. "src/hal/touch_sensor_hal.c"
  15. "src/soc_include_legacy_warn.c"
  16. "src/hal/pcnt_hal.c"
  17. "src/hal/i2s_hal.c"
  18. "src/hal/sigmadelta_hal.c"
  19. "src/hal/timer_hal.c"
  20. "src/hal/ledc_hal.c"
  21. "src/hal/ledc_hal_iram.c"
  22. "src/hal/i2c_hal.c"
  23. "src/hal/i2c_hal_iram.c"
  24. "src/hal/gpio_hal.c"
  25. "src/hal/uart_hal.c"
  26. "src/hal/uart_hal_iram.c"
  27. "src/hal/spi_flash_hal.c"
  28. "src/hal/spi_flash_hal_iram.c"
  29. "src/hal/mpu_hal.c"
  30. "src/hal/soc_hal.c"
  31. "src/hal/wdt_hal_iram.c"
  32. "src/compare_set.c"
  33. "src/hal/twai_hal.c"
  34. "src/hal/twai_hal_iram.c"
  35. PRIV_REQUIRES ${target}
  36. LDFRAGMENTS linker.lf)
  37. if(CONFIG_IDF_TARGET_ESP32)
  38. target_sources(${COMPONENT_LIB} PRIVATE "src/hal/mcpwm_hal.c"
  39. "src/hal/sdio_slave_hal.c")
  40. elseif(CONFIG_IDF_TARGET_ESP32S2)
  41. target_sources(${COMPONENT_LIB} PRIVATE "src/hal/spi_flash_hal_gpspi.c")
  42. endif()
  43. # Since there can be chip-specific HAL headers which can include the common
  44. # HAL header via include_next, process the build scripts here first so that
  45. # include directories appear first in the compile command.
  46. add_subdirectory(src/${target})
  47. target_include_directories(${COMPONENT_LIB} PUBLIC include)
  48. add_subdirectory(soc)
  49. target_link_libraries(${COMPONENT_LIB} PUBLIC "soc_${target}")