Просмотр исходного кода

RT kernel support for ChibiOS.

Konstantin Oblaukhov 10 лет назад
Родитель
Сommit
4de722a7e6
1 измененных файлов с 11 добавлено и 3 удалено
  1. 11 3
      cmake/Modules/ChibiOS3.cmake

+ 11 - 3
cmake/Modules/ChibiOS3.cmake

@@ -1,10 +1,12 @@
 IF(NOT ChibiOS_FIND_COMPONENTS) 
-    SET(ChibiOS_FIND_COMPONENTS nil)
+    SET(ChibiOS_FIND_COMPONENTS nil hal st)
     MESSAGE(STATUS "No ChibiOS components specified, using default: ${ChibiOS_FIND_COMPONENTS}")
 ENDIF()
 
 LIST(FIND ChibiOS_FIND_COMPONENTS nil ChibiOS_FIND_COMPONENTS_nil)
 LIST(FIND ChibiOS_FIND_COMPONENTS rt ChibiOS_FIND_COMPONENTS_rt)
+LIST(FIND ChibiOS_FIND_COMPONENTS hal ChibiOS_FIND_COMPONENTS_hal)
+LIST(FIND ChibiOS_FIND_COMPONENTS st ChibiOS_FIND_COMPONENTS_st)
 
 IF((${ChibiOS_FIND_COMPONENTS_nil} LESS 0) AND (${ChibiOS_FIND_COMPONENTS_rt} LESS 0))
   MESSAGE(STATUS "No kernel component selected, using Nil kernel")
@@ -21,6 +23,14 @@ ELSE()
   ENDIF()
 ENDIF()
 
+IF(${ChibiOS_FIND_COMPONENTS_hal} LESS 0)
+  LIST(APPEND ChibiOS_FIND_COMPONENTS hal)
+ENDIF()
+
+IF(${ChibiOS_FIND_COMPONENTS_st} LESS 0)
+  LIST(APPEND ChibiOS_FIND_COMPONENTS st)
+ENDIF()
+  
 INCLUDE(ChibiOS3_LD)
 INCLUDE(ChibiOS3_HAL)
 
@@ -28,8 +38,6 @@ IF(${CHIBIOS_KERNEL} STREQUAL rt)
   INCLUDE(ChibiOS3_RT)
 ELSE()
   INCLUDE(ChibiOS3_NIL)
-  # Ugly, but requred
-  LIST(APPEND ChibiOS_FIND_COMPONENTS hal st)
 ENDIF()
 
 SET(CHIBIOS_COMPONENTS nil rt hal ${CHIBIOS_HAL_MODULES})