Skip to content

Commit

Permalink
Add option to not include heap in CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonpcarroll authored Nov 30, 2022
1 parent 91927ab commit cdb854f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,25 @@ endif()

add_subdirectory(portable)

add_library(freertos_kernel STATIC
list(APPEND FREERTOS_KERNEL_SOURCES
event_groups.c
list.c
queue.c
stream_buffer.c
tasks.c
timers.c
)

# If FREERTOS_HEAP is digit between 1 .. 5 - it is heap number, otherwise - it is path to custom heap source file
$<IF:$<BOOL:$<FILTER:${FREERTOS_HEAP},EXCLUDE,^[1-5]$>>,${FREERTOS_HEAP},portable/MemMang/heap_${FREERTOS_HEAP}.c>
# Check if user requested to not inlude a heap implementation
if(NOT DEFINED FREERTOS_DO_NOT_INCLUDE_HEAP)
list(APPEND FREERTOS_KERNEL_SOURCES
# If FREERTOS_HEAP is digit between 1 .. 5 - it is heap number, otherwise - it is path to custom heap source file
$<IF:$<BOOL:$<FILTER:${FREERTOS_HEAP},EXCLUDE,^[1-5]$>>,${FREERTOS_HEAP},portable/MemMang/heap_${FREERTOS_HEAP}.c>
)
endif()

add_library(freertos_kernel STATIC
${FREERTOS_KERNEL_SOURCES}
)

target_include_directories(freertos_kernel
Expand Down

0 comments on commit cdb854f

Please sign in to comment.