library.cmake 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
  2. #
  3. # SPDX-License-Identifier: BSD-3-Clause
  4. # Called after the Raspberry Pi Pico SDK has been initialized to add our libraries
  5. add_library(FreeRTOS-Kernel-Core INTERFACE)
  6. target_sources(FreeRTOS-Kernel-Core INTERFACE
  7. ${FREERTOS_KERNEL_PATH}/croutine.c
  8. ${FREERTOS_KERNEL_PATH}/event_groups.c
  9. ${FREERTOS_KERNEL_PATH}/list.c
  10. ${FREERTOS_KERNEL_PATH}/queue.c
  11. ${FREERTOS_KERNEL_PATH}/stream_buffer.c
  12. ${FREERTOS_KERNEL_PATH}/tasks.c
  13. ${FREERTOS_KERNEL_PATH}/timers.c
  14. )
  15. target_include_directories(FreeRTOS-Kernel-Core INTERFACE ${FREERTOS_KERNEL_PATH}/include)
  16. add_library(FreeRTOS-Kernel INTERFACE)
  17. target_sources(FreeRTOS-Kernel INTERFACE
  18. ${CMAKE_CURRENT_LIST_DIR}/port.c
  19. )
  20. target_include_directories(FreeRTOS-Kernel INTERFACE
  21. ${CMAKE_CURRENT_LIST_DIR}/include)
  22. target_link_libraries(FreeRTOS-Kernel INTERFACE
  23. FreeRTOS-Kernel-Core
  24. pico_base_headers
  25. hardware_exception)
  26. target_compile_definitions(FreeRTOS-Kernel INTERFACE
  27. LIB_FREERTOS_KERNEL=1
  28. FREERTOS_KERNEL_SMP=0
  29. )
  30. add_library(FreeRTOS-Kernel-Static INTERFACE)
  31. target_compile_definitions(FreeRTOS-Kernel-Static INTERFACE
  32. configSUPPORT_STATIC_ALLOCATION=1
  33. )
  34. target_sources(FreeRTOS-Kernel-Static INTERFACE ${CMAKE_CURRENT_LIST_DIR}/idle_task_static_memory.c)
  35. target_link_libraries(FreeRTOS-Kernel-Static INTERFACE FreeRTOS-Kernel)
  36. add_library(FreeRTOS-Kernel-Heap1 INTERFACE)
  37. target_sources(FreeRTOS-Kernel-Heap1 INTERFACE ${FREERTOS_KERNEL_PATH}/portable/MemMang/heap_1.c)
  38. target_link_libraries(FreeRTOS-Kernel-Heap1 INTERFACE FreeRTOS-Kernel)
  39. add_library(FreeRTOS-Kernel-Heap2 INTERFACE)
  40. target_sources(FreeRTOS-Kernel-Heap2 INTERFACE ${FREERTOS_KERNEL_PATH}/portable/MemMang/heap_2.c)
  41. target_link_libraries(FreeRTOS-Kernel-Heap2 INTERFACE FreeRTOS-Kernel)
  42. add_library(FreeRTOS-Kernel-Heap3 INTERFACE)
  43. target_sources(FreeRTOS-Kernel-Heap3 INTERFACE ${FREERTOS_KERNEL_PATH}/portable/MemMang/heap_3.c)
  44. target_link_libraries(FreeRTOS-Kernel-Heap3 INTERFACE FreeRTOS-Kernel)
  45. add_library(FreeRTOS-Kernel-Heap4 INTERFACE)
  46. target_sources(FreeRTOS-Kernel-Heap4 INTERFACE ${FREERTOS_KERNEL_PATH}/portable/MemMang/heap_4.c)
  47. target_link_libraries(FreeRTOS-Kernel-Heap4 INTERFACE FreeRTOS-Kernel)
  48. add_library(FreeRTOS-Kernel-Heap5 INTERFACE)
  49. target_sources(FreeRTOS-Kernel-Heap5 INTERFACE ${FREERTOS_KERNEL_PATH}/portable/MemMang/heap_5.c)
  50. target_link_libraries(FreeRTOS-Kernel-Heap5 INTERFACE FreeRTOS-Kernel)