diff --git a/CMakeLists.txt b/CMakeLists.txt index 46a9e180796..a68b652cada 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,7 +225,7 @@ elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_ " .)\n" " target_link_libraries(freertos_kernel_port\n" " PRIVATE\n" - " freertos_kernel)") + " freertos_kernel_include)") endif() ######################################################################## @@ -264,6 +264,7 @@ add_compile_options( ######################################################################## +add_subdirectory(include) add_subdirectory(portable) add_library(freertos_kernel STATIC @@ -279,17 +280,10 @@ add_library(freertos_kernel STATIC $>,${FREERTOS_HEAP},portable/MemMang/heap_${FREERTOS_HEAP}.c> ) -target_include_directories(freertos_kernel - PUBLIC - include - # Note: DEPRECATED but still supported, may be removed in a future release. - $<$>:${FREERTOS_CONFIG_FILE_DIRECTORY}> -) - target_link_libraries(freertos_kernel PUBLIC - $<$:freertos_config> freertos_kernel_port + freertos_kernel_include ) ######################################################################## diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 00000000000..46a1c3e7f5f --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,15 @@ +# FreeRTOS internal cmake file. Do not use it in user top-level project + +add_library(freertos_kernel_include INTERFACE) + +target_include_directories(freertos_kernel_include + INTERFACE + . + # Note: DEPRECATED but still supported, may be removed in a future release. + $<$>:${FREERTOS_CONFIG_FILE_DIRECTORY}> +) + +target_link_libraries(freertos_kernel_include + INTERFACE + $<$:freertos_config> +) diff --git a/portable/CMakeLists.txt b/portable/CMakeLists.txt index 2824df05dc0..988be152406 100644 --- a/portable/CMakeLists.txt +++ b/portable/CMakeLists.txt @@ -1035,7 +1035,7 @@ target_link_libraries(freertos_kernel_port $<$:pico_base_headers> $<$:idf::esp32> PRIVATE - freertos_kernel + freertos_kernel_include $<$:Threads::Threads> "$<$:hardware_clocks;hardware_exception>" $<$:winmm> # Windows library which implements timers