From cdb854ffc60de71f95ca681c7f02a5dbd9df7c02 Mon Sep 17 00:00:00 2001 From: jasonpcarroll <23126711+jasonpcarroll@users.noreply.github.com> Date: Wed, 30 Nov 2022 14:19:14 -0800 Subject: [PATCH] Add option to not include heap in CMakeLists.txt --- CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d4a7799f7c..ec60888d608 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 - $>,${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 + $>,${FREERTOS_HEAP},portable/MemMang/heap_${FREERTOS_HEAP}.c> + ) +endif() + +add_library(freertos_kernel STATIC + ${FREERTOS_KERNEL_SOURCES} ) target_include_directories(freertos_kernel