Skip to content

Commit f53f039

Browse files
committed
made more generic
1 parent 8be8472 commit f53f039

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

RTEMSConfig.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
function(rtems_general_config TARGET_NAME RTEMS_INST RTEMS_BSP)
1212

13+
set(RTEMS_BSP_LIB_PATH CACHE INTERNAL "")
14+
set(RTEMS_BSP_INC_PATH CACHE INTERNAL "")
15+
1316
include(${RTEMS_CONFIG_DIRECTORY}/RTEMSGeneric.cmake)
1417
rtems_generic_config(${TARGET_NAME} ${RTEMS_INST} ${RTEMS_BSP})
1518

RTEMSGeneric.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ message(STATUS "RTEMS linker: ${RTEMS_LINKER}")
103103
if(${RTEMS_ARCH_NAME} STREQUAL "arm")
104104
set(CMAKE_SYSTEM_PROCESSOR arm PARENT_SCOPE)
105105
endif()
106-
107-
target_link_directories(${TARGET_NAME} PUBLIC
108-
${RTEMS_BSP_LIB_PATH})
109-
target_include_directories(${TARGET_NAME} PUBLIC
110-
${RTEMS_BSP_INC_PATH})
111106

112107
###############################################################################
113108
# Setting variables in upper scope (only the upper scope!)
@@ -118,4 +113,7 @@ set(CMAKE_CXX_COMPILER ${RTEMS_GXX} PARENT_SCOPE)
118113
set(CMAKE_ASM_COMPILER ${RTEMS_ASM} PARENT_SCOPE)
119114
set(CMAKE_LINKER ${RTEMS_LINKER} PARENT_SCOPE)
120115

116+
set(RTEMS_BSP_LIB_PATH ${RTEMS_BSP_LIB_PATH} PARENT_SCOPE)
117+
set(RTEMS_BSP_INC_PATH ${RTEMS_BSP_INC_PATH} PARENT_SCOPE)
118+
121119
endfunction()

RTEMSHardware.cmake

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,32 @@
1010
function(rtems_hw_config TARGET_NAME RTEMS_INST RTEMS_BSP)
1111

1212
if(RTEMS_BSP STREQUAL "arm/stm32h7")
13-
target_compile_options(${TARGET_NAME} PUBLIC
14-
-mthumb
15-
-mcpu=cortex-m7
13+
14+
set(ABI_FLAGS
15+
-mthumb
16+
-mcpu=cortex-m7
1617
-mfpu=fpv5-d16
1718
-mfloat-abi=hard
1819
)
1920

21+
target_compile_options(${TARGET_NAME} PUBLIC
22+
"${ABI_FLAGS}"
23+
)
24+
25+
target_include_directories(${TARGET_NAME} PUBLIC
26+
"${RTEMS_BSP_INC_PATH}"
27+
)
28+
2029
target_link_options(${TARGET_NAME} BEFORE PUBLIC
21-
-mthumb
22-
-mcpu=cortex-m7
23-
-mfpu=fpv5-d16
24-
-mfloat-abi=hard
30+
"${ABI_FLAGS}"
2531
)
2632

2733
target_link_options(${TARGET_NAME} PUBLIC
2834
-Wl,--gc-sections
2935
-Wl,-Bstatic
3036
-Wl,-Bdynamic
3137
-qrtems
38+
-B${RTEMS_BSP_LIB_PATH}
3239
)
3340

3441
endif()

0 commit comments

Comments
 (0)