forked from ARM-software/CMSIS-FreeRTOS
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
G3P-7233: Convert library to Interface target for new build configura…
…tion
- Loading branch information
1 parent
834e8ab
commit 63fc088
Showing
5 changed files
with
581 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
# defines library FW3_CMSIS_TARGET | ||
|
||
add_library(FW3_CMSIS_TARGET) | ||
function(generate_freertos_cmsis | ||
SUFFIX) | ||
|
||
add_library(CMSIS_RTOS2_FreeRTOS-${SUFFIX} INTERFACE) | ||
|
||
add_library(ThirdParty::ARM::RTOS2::FreeRTOS::${SUFFIX} ALIAS CMSIS_RTOS2_FreeRTOS-${SUFFIX}) | ||
|
||
target_sources( | ||
FW3_CMSIS_TARGET | ||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Source/cmsis_os2.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/Source/freertos_evr.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/Source/os_systick.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/Source/ARM/clib_arm.c) | ||
CMSIS_RTOS2_FreeRTOS-${SUFFIX} | ||
INTERFACE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Source/cmsis_os2.c | ||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Source/freertos_evr.c | ||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Source/os_systick.c | ||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Source/ARM/clib_arm.c | ||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Source/cmsis_os1.c) | ||
|
||
set_source_files_properties(${FW3_CMSIS_DIR}/Source/cmsis_os1.c | ||
target_include_directories(CMSIS_RTOS2_FreeRTOS-${SUFFIX} INTERFACE | ||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Include | ||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Include1 | ||
) | ||
|
||
set_source_files_properties(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Source/cmsis_os1.c | ||
PROPERTIES COMPILE_OPTIONS -Wno-switch-enum) | ||
|
||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cmake_minimum_required(VERSION 3.30) | ||
|
||
function(generate_freertos_libs | ||
SUFFIX | ||
FREERTOS_CONFIG_LIBRARY | ||
FREERTOS_PORT) | ||
|
||
add_subdirectory(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Source ${CMAKE_CURRENT_BINARY_DIR}/${SUFFIX}/FreeRtosSource) | ||
add_subdirectory(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CMSIS/RTOS2/FreeRTOS | ||
${CMAKE_CURRENT_BINARY_DIR}/${SUFFIX}/FreeRtosCmsis) | ||
|
||
generate_freertos_cmsis(${SUFFIX}) | ||
generate_freertos_kernel(${SUFFIX} ${FREERTOS_CONFIG_LIBRARY} ${FREERTOS_PORT}) | ||
|
||
target_link_libraries(CMSIS_RTOS2_FreeRTOS-${SUFFIX} INTERFACE freertos_kernel-${SUFFIX}) | ||
|
||
endfunction() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# FreeRTOS internal cmake file. Do not use it in user top-level project | ||
|
||
function(generate_freertos_kernel_include | ||
SUFFIX | ||
FREERTOS_CONFIG_LIBRARY) | ||
|
||
add_library(freertos_kernel_include-${SUFFIX} INTERFACE) | ||
|
||
target_include_directories(freertos_kernel_include-${SUFFIX} | ||
INTERFACE | ||
${CMAKE_CURRENT_FUNCTION_LIST_DIR} | ||
# Note: DEPRECATED but still supported, may be removed in a future release. | ||
$<$<NOT:$<TARGET_EXISTS:${FREERTOS_CONFIG_LIBRARY}>>:${FREERTOS_CONFIG_FILE_DIRECTORY}> | ||
) | ||
|
||
target_link_libraries(freertos_kernel_include-${SUFFIX} | ||
INTERFACE | ||
$<$<TARGET_EXISTS:${FREERTOS_CONFIG_LIBRARY}>:${FREERTOS_CONFIG_LIBRARY}> | ||
) | ||
|
||
endfunction() |
Oops, something went wrong.