-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathtarget.cmake
More file actions
44 lines (36 loc) · 1.32 KB
/
target.cmake
File metadata and controls
44 lines (36 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# target board
if(NOT DEFINED TARGET_BOARD)
set(TARGET_BOARD "wraith32")
message("no TARGET_BOARD defined, using ${TARGET_BOARD}")
endif()
# target board directory
set(TARGET_DIR "${PROJECT_SOURCE_DIR}/src/target")
set(TARGET_SRC ${TARGET_DIR}/${TARGET_BOARD}/target.c)
# include target board CMakeLists
include(${TARGET_DIR}/${TARGET_BOARD}/target-mcu.cmake)
# target part
# TODO fail if not set
message("TARGET_MCU: ${TARGET_MCU}")
include(${BOILERPLATE}/src/target-mcu.cmake)
# target architecture
# TODO fail if not set
message("TARGET_CPU: ${TARGET_CPU}")
# include target board defintions
include_directories(${TARGET_DIR}/${TARGET_BOARD})
if(TARGET_MCU MATCHES "STM32.*")
include_directories(${TARGET_DIR}/inc/stm32/common)
if(TARGET_MCU MATCHES "STM32F0.*")
include_directories(${TARGET_DIR}/inc/stm32/f0)
set(ISR_SRC ${TARGET_DIR}/inc/stm32/f0/isr.c)
elseif(TARGET_MCU MATCHES "STM32F3.*")
include_directories(${TARGET_DIR}/inc/stm32/f3)
set(ISR_SRC ${TARGET_DIR}/inc/stm32/f3/isr.c)
elseif(TARGET_MCU MATCHES "STM32G4.*")
include_directories(${TARGET_DIR}/inc/stm32/g4)
set(ISR_SRC ${TARGET_DIR}/inc/stm32/g4/isr.c)
else()
message("unsupported TARGET_MCU: ${TARGET_MCU}")
endif()
else()
message("unsupported TARGET_MCU: ${TARGET_MCU}")
endif()