From 682f0515c984da0ef283b12e99791e5ab7b41034 Mon Sep 17 00:00:00 2001 From: yh-sb Date: Mon, 25 Nov 2024 07:24:41 +0200 Subject: [PATCH] Fix CMake build for RP2040 (#1197) Add public dependency to hardware_sync because portable\ThirdParty\GCC\RP2040\include\portmacro.h exposes include "hardware/sync.h" to FreeRTOS.h which is PUBLIC. Add private dependency to pico_multicore because of usage prvFIFOInterruptHandler() and sio_hw in portable/ThirdParty/GCC/RP2040/port.c. --- portable/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/portable/CMakeLists.txt b/portable/CMakeLists.txt index f761ebc47e3..5e43877bbc0 100644 --- a/portable/CMakeLists.txt +++ b/portable/CMakeLists.txt @@ -1215,6 +1215,11 @@ target_include_directories(freertos_kernel_port_headers INTERFACE $<$:${CMAKE_CURRENT_LIST_DIR}/WizC/PIC18> ) +target_link_libraries(freertos_kernel_port_headers + INTERFACE + $<$:hardware_sync> +) + if(FREERTOS_PORT STREQUAL GCC_POSIX) find_package(Threads REQUIRED) endif() @@ -1227,6 +1232,6 @@ target_link_libraries(freertos_kernel_port PRIVATE freertos_kernel_include $<$:Threads::Threads> - "$<$:hardware_clocks;hardware_exception>" + "$<$:hardware_clocks;hardware_exception;pico_multicore>" $<$:winmm> # Windows library which implements timers )