CMakeLists.txt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. if(BOOTLOADER_BUILD)
  2. # bootloader only needs FreeRTOS for config, not for anything else
  3. idf_component_register()
  4. return()
  5. endif()
  6. set(srcs
  7. "xtensa/port.c"
  8. "xtensa/portasm.S"
  9. "xtensa/xtensa_context.S"
  10. "xtensa/xtensa_init.c"
  11. "xtensa/xtensa_intr_asm.S"
  12. "xtensa/xtensa_intr.c"
  13. "xtensa/xtensa_overlay_os_hook.c"
  14. "xtensa/xtensa_vector_defaults.S"
  15. "xtensa/xtensa_vectors.S")
  16. list(APPEND srcs
  17. "croutine.c"
  18. "event_groups.c"
  19. "FreeRTOS-openocd.c"
  20. "list.c"
  21. "queue.c"
  22. "tasks.c"
  23. "timers.c")
  24. set(include_dirs
  25. include
  26. xtensa/include)
  27. set(private_include_dirs
  28. include/freertos
  29. xtensa/include/freertos
  30. xtensa
  31. .)
  32. if(CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
  33. list(APPEND srcs "xtensa/xtensa_loadstore_handler.S")
  34. endif()
  35. # app_trace is required by FreeRTOS headers only when CONFIG_SYSVIEW_ENABLE=y,
  36. # but requirements can't depend on config options, so always require it.
  37. idf_component_register(SRCS "${srcs}"
  38. INCLUDE_DIRS ${include_dirs}
  39. PRIV_INCLUDE_DIRS ${private_include_dirs}
  40. LDFRAGMENTS linker.lf
  41. REQUIRES app_trace esp_timer
  42. PRIV_REQUIRES soc)
  43. idf_component_get_property(COMPONENT_DIR freertos COMPONENT_DIR)
  44. idf_component_set_property(freertos ORIG_INCLUDE_PATH "${COMPONENT_DIR}/include/freertos/")
  45. if(CONFIG_FREERTOS_DEBUG_OCDAWARE)
  46. target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=uxTopUsedPriority")
  47. endif()
  48. set_source_files_properties(
  49. tasks.c
  50. event_groups.c
  51. timers.c
  52. queue.c
  53. PROPERTIES COMPILE_DEFINITIONS
  54. _ESP_FREERTOS_INTERNAL
  55. )