From 93fca5e0cac3f8244b12e181f283b5c989df9252 Mon Sep 17 00:00:00 2001 From: MrJake222 Date: Thu, 22 Jun 2023 10:28:52 +0200 Subject: [PATCH 1/3] Fixed compile options polluting project Moved add_library higher --- CMakeLists.txt | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46a9e180796..69546ce3127 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,6 +228,24 @@ elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_ " freertos_kernel)") endif() + +######################################################################## +add_subdirectory(portable) + +add_library(freertos_kernel STATIC + croutine.c + 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> + ) + + ######################################################################## # Overall Compile Options # Note the compile option strategy is to error on everything and then @@ -248,7 +266,7 @@ endif() # MSVC | MSVC # Note only for MinGW? # Renesas | ?TBD? -add_compile_options( +target_compile_options(freertos_kernel PRIVATE ### Gnu/Clang C Options $<$:-fdiagnostics-color=always> $<$:-fcolor-diagnostics> @@ -262,23 +280,6 @@ add_compile_options( # TODO: Add in other Compilers here. ) - -######################################################################## -add_subdirectory(portable) - -add_library(freertos_kernel STATIC - croutine.c - 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> -) - target_include_directories(freertos_kernel PUBLIC include From a34bb0ad4ac76837a540862d2341e7868249b1a8 Mon Sep 17 00:00:00 2001 From: "Mr. Jake" Date: Sat, 1 Jul 2023 19:06:49 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Paul Bartell --- CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69546ce3127..40a91fc7120 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,7 +228,7 @@ elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_ " freertos_kernel)") endif() - +add_library(freertos_kernel STATIC) ######################################################################## add_subdirectory(portable) @@ -279,7 +279,21 @@ target_compile_options(freertos_kernel PRIVATE # TODO: Add in other Compilers here. ) +######################################################################## +add_subdirectory(portable) +target_sources(freertos_kernel + croutine.c + 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> +) target_include_directories(freertos_kernel PUBLIC include From 31d0c74abe6533e3a0c836030ac244f6479f4d3a Mon Sep 17 00:00:00 2001 From: MrJake222 Date: Sat, 1 Jul 2023 19:12:58 +0200 Subject: [PATCH 3/3] fixed cmakelists keeping in mind the suggestions --- CMakeLists.txt | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40a91fc7120..744174f8eae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,23 +228,8 @@ elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_ " freertos_kernel)") endif() -add_library(freertos_kernel STATIC) -######################################################################## -add_subdirectory(portable) - -add_library(freertos_kernel STATIC - croutine.c - 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> - ) +add_library(freertos_kernel STATIC) ######################################################################## # Overall Compile Options @@ -279,10 +264,12 @@ target_compile_options(freertos_kernel PRIVATE # TODO: Add in other Compilers here. ) + + ######################################################################## add_subdirectory(portable) -target_sources(freertos_kernel +target_sources(freertos_kernel PRIVATE croutine.c event_groups.c list.c