-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
50 lines (38 loc) · 1.29 KB
/
CMakeLists.txt
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
45
46
47
48
49
50
cmake_minimum_required(VERSION 3.9)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "cmake/disable_extralibs.cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
project(stm32-bootloader)
include(platform)
include(jlink_upload)
include(pkgtools)
# Build the external code
add_subdirectory(extern)
# Build the bootloader application
set(BOOTLOADER_SOURCES
"src/Bootloader.cpp"
"src/Uart.cpp"
"src/Can.cpp"
"src/System.cpp"
"src/Flash.cpp")
set(BOOTLOADER_INCLUDES
"include/Bootloader.hpp"
"include/Uart.hpp"
"include/Can.hpp"
"include/System.hpp"
"include/Buffer.hpp"
"include/Flash.hpp"
"include/Pin.hpp")
use_platform(stm32f777vi)
function(add_bootloader BOARD_NAME MAIN)
add_executable("${BOARD_NAME}-bootloader" ${BOOTLOADER_SOURCES} ${BOOTLOADER_INCLUDES} ${MAIN})
target_link_libraries("${BOARD_NAME}-bootloader"
startup_stm32f777vi
hal_stm32f777vi)
target_include_directories("${BOARD_NAME}-bootloader"
PUBLIC "include")
add_jlink_upload("${BOARD_NAME}-bootloader" stm32f777vi)
endfunction(add_bootloader)
# Add the default bootloader
add_bootloader(default "src/main.cpp")
add_bootloader(boarda "config/boarda.cpp")
add_bootloader(boardb "config/boardb.cpp")