forked from epagris/FreeRTOS-Kernel
custom tag added
This commit is contained in:
parent
27c4feff66
commit
934ba2b52d
@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.15)
|
||||
# implementation (e.g. when only static allocation is used).
|
||||
|
||||
# `freertos_config` target defines the path to FreeRTOSConfig.h and optionally other freertos based config files
|
||||
if(NOT TARGET freertos_config )
|
||||
if(NOT TARGET freertos_config_${FREERTOS_TAG} )
|
||||
if (NOT DEFINED FREERTOS_CONFIG_FILE_DIRECTORY )
|
||||
|
||||
message(FATAL_ERROR " freertos_config target not specified. Please specify a cmake target that defines the include directory for FreeRTOSConfig.h:\n"
|
||||
@ -210,7 +210,7 @@ if(NOT FREERTOS_PORT)
|
||||
message(STATUS " Auto-Detected MINGW, setting FREERTOS_PORT=MSVC_MINGW")
|
||||
set(FREERTOS_PORT MSVC_MINGW CACHE STRING "FreeRTOS port name")
|
||||
endif()
|
||||
elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_port) )
|
||||
elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_port_${FREERTOS_TAG}) )
|
||||
message(FATAL_ERROR " FREERTOS_PORT is set to A_CUSTOM_PORT. Please specify the custom port target with all necessary files. For example:\n"
|
||||
" Assuming a directory of:\n"
|
||||
" FreeRTOSCustomPort/\n"
|
||||
@ -232,13 +232,13 @@ elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_
|
||||
" freertos_kernel_include)")
|
||||
endif()
|
||||
|
||||
add_library(freertos_kernel STATIC)
|
||||
add_library(freertos_kernel_${FREERTOS_TAG} STATIC)
|
||||
|
||||
########################################################################
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(portable)
|
||||
|
||||
target_sources(freertos_kernel PRIVATE
|
||||
target_sources(freertos_kernel_${FREERTOS_TAG} PRIVATE
|
||||
croutine.c
|
||||
event_groups.c
|
||||
list.c
|
||||
@ -250,14 +250,14 @@ target_sources(freertos_kernel PRIVATE
|
||||
|
||||
if (DEFINED FREERTOS_HEAP )
|
||||
# User specified a heap implementation add heap implementation to freertos_kernel.
|
||||
target_sources(freertos_kernel PRIVATE
|
||||
target_sources(freertos_kernel_${FREERTOS_TAG} PRIVATE
|
||||
# If FREERTOS_HEAP is digit between 1 .. 5 - it is heap number, otherwise - it is path to custom heap source file
|
||||
$<IF:$<BOOL:$<FILTER:${FREERTOS_HEAP},EXCLUDE,^[1-5]$>>,${FREERTOS_HEAP},portable/MemMang/heap_${FREERTOS_HEAP}.c>
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
target_link_libraries(freertos_kernel
|
||||
target_link_libraries(freertos_kernel_${FREERTOS_TAG}
|
||||
PUBLIC
|
||||
freertos_kernel_include
|
||||
freertos_kernel_port_headers
|
||||
|
@ -1,15 +1,15 @@
|
||||
# FreeRTOS internal cmake file. Do not use it in user top-level project
|
||||
|
||||
add_library(freertos_kernel_include INTERFACE)
|
||||
add_library(freertos_kernel_include_${FREERTOS_TAG} INTERFACE)
|
||||
|
||||
target_include_directories(freertos_kernel_include
|
||||
target_include_directories(freertos_kernel_include_${FREERTOS_TAG}
|
||||
INTERFACE
|
||||
.
|
||||
# Note: DEPRECATED but still supported, may be removed in a future release.
|
||||
$<$<NOT:$<TARGET_EXISTS:freertos_config>>:${FREERTOS_CONFIG_FILE_DIRECTORY}>
|
||||
)
|
||||
|
||||
target_link_libraries(freertos_kernel_include
|
||||
target_link_libraries(freertos_kernel_include_${FREERTOS_TAG}
|
||||
INTERFACE
|
||||
$<$<TARGET_EXISTS:freertos_config>:freertos_config>
|
||||
)
|
||||
|
@ -15,7 +15,7 @@ endif()
|
||||
|
||||
# FreeRTOS internal cmake file. Do not use it in user top-level project
|
||||
|
||||
add_library(freertos_kernel_port OBJECT
|
||||
add_library(freertos_kernel_port_${FREERTOS_TAG} OBJECT
|
||||
# TEMPLATE Port
|
||||
$<$<STREQUAL:${FREERTOS_PORT},TEMPLATE>:
|
||||
template/port.c>
|
||||
@ -757,14 +757,14 @@ if( FREERTOS_PORT MATCHES "GCC_ARM_CM(3|4)_MPU" OR
|
||||
FREERTOS_PORT MATCHES "IAR_ARM_CM(23|33|55|85)_NTZ_NONSECURE" OR
|
||||
FREERTOS_PORT MATCHES "IAR_ARM_CM(23|33|55|85)_NONSECURE"
|
||||
)
|
||||
target_sources(freertos_kernel_port PRIVATE
|
||||
target_sources(freertos_kernel_port_${FREERTOS_TAG} PRIVATE
|
||||
Common/mpu_wrappers.c
|
||||
Common/mpu_wrappers_v2.c
|
||||
)
|
||||
endif()
|
||||
add_library(freertos_kernel_port_headers INTERFACE)
|
||||
add_library(freertos_kernel_port_headers_${FREERTOS_TAG} INTERFACE)
|
||||
|
||||
target_include_directories(freertos_kernel_port_headers INTERFACE
|
||||
target_include_directories(freertos_kernel_port_headers_${FREERTOS_TAG} INTERFACE
|
||||
# TEMPLATE Port
|
||||
$<$<STREQUAL:${FREERTOS_PORT},TEMPLATE>:${CMAKE_CURRENT_LIST_DIR}/template>
|
||||
|
||||
@ -1099,7 +1099,7 @@ if(FREERTOS_PORT STREQUAL GCC_POSIX)
|
||||
find_package(Threads REQUIRED)
|
||||
endif()
|
||||
|
||||
target_link_libraries(freertos_kernel_port
|
||||
target_link_libraries(freertos_kernel_port_${FREERTOS_TAG}
|
||||
PUBLIC
|
||||
$<$<STREQUAL:${FREERTOS_PORT},GCC_RP2040>:pico_base_headers>
|
||||
$<$<STREQUAL:${FREERTOS_PORT},GCC_XTENSA_ESP32>:idf::esp32>
|
||||
|
Loading…
x
Reference in New Issue
Block a user