From 6f6f656aa75c66c2ba377b060f5bb4da3ec1497a Mon Sep 17 00:00:00 2001 From: "Mr. Jake" Date: Sun, 16 Jul 2023 00:16:31 +0200 Subject: [PATCH] Fixed compile options polluting project (#694) * Fixed compile options polluting project Moved add_library higher * Apply suggestions from code review Co-authored-by: Paul Bartell * fixed cmakelists keeping in mind the suggestions --------- Co-authored-by: Paul Bartell Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com> --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a68b652ca..c57d46402 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,6 +228,9 @@ elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_ " freertos_kernel_include)") endif() + +add_library(freertos_kernel STATIC) + ######################################################################## # Overall Compile Options # Note the compile option strategy is to error on everything and then @@ -248,7 +251,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> @@ -267,7 +270,7 @@ add_compile_options( add_subdirectory(include) add_subdirectory(portable) -add_library(freertos_kernel STATIC +target_sources(freertos_kernel PRIVATE croutine.c event_groups.c list.c @@ -280,6 +283,7 @@ add_library(freertos_kernel STATIC $>,${FREERTOS_HEAP},portable/MemMang/heap_${FREERTOS_HEAP}.c> ) + target_link_libraries(freertos_kernel PUBLIC freertos_kernel_port