Skip to content

Commit

Permalink
Fixed compile options polluting project (#694)
Browse files Browse the repository at this point in the history
* Fixed compile options polluting project

Moved add_library higher

* Apply suggestions from code review

Co-authored-by: Paul Bartell <[email protected]>

* fixed cmakelists keeping in mind the suggestions

---------

Co-authored-by: Paul Bartell <[email protected]>
Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>
  • Loading branch information
4 people authored Jul 15, 2023
1 parent b60ab2f commit 6f6f656
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
$<$<COMPILE_LANG_AND_ID:C,GNU>:-fdiagnostics-color=always>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-fcolor-diagnostics>
Expand All @@ -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
Expand All @@ -280,6 +283,7 @@ add_library(freertos_kernel STATIC
$<IF:$<BOOL:$<FILTER:${FREERTOS_HEAP},EXCLUDE,^[1-5]$>>,${FREERTOS_HEAP},portable/MemMang/heap_${FREERTOS_HEAP}.c>
)


target_link_libraries(freertos_kernel
PUBLIC
freertos_kernel_port
Expand Down

0 comments on commit 6f6f656

Please sign in to comment.