-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
executable file
·51 lines (41 loc) · 945 Bytes
/
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
51
cmake_minimum_required(VERSION 3.0)
project(blinky)
set(ELF ${PROJECT_NAME}.elf)
enable_language(ASM)
set(STARTUP_FILE "startup_stm32f103xb.c")
add_subdirectory(stm32f1-ll)
add_executable(${ELF} ${STARTUP_FILE}
src/main.c)
target_include_directories(${ELF} PUBLIC inc)
target_link_libraries(${ELF} ll )
target_include_directories(${ELF} PUBLIC inc)
set_target_properties(
${ELF}
PROPERTIES
LINK_FLAGS
"-T${PROJECT_SOURCE_DIR}/STM32F103RBTx_FLASH.ld \
-mthumb -mcpu=cortex-m3 \
-Wl,--gc-sections \
-Wl,-Map=${PROJECT_NAME}.map")
target_compile_options(${ELF} PUBLIC
-Wall
-g
-std=gnu99
-Os
-mthumb
-mcpu=cortex-m3
-mfloat-abi=soft
-mlittle-endian
-ffunction-sections
-fdata-sections
-Werror
-Wstrict-prototypes
-Warray-bounds
-fno-strict-aliasing
-Wno-unused-const-variable
-specs=nano.specs
-specs=nosys.specs)
file(COPY
openocd.cfg
DESTINATION
${CMAKE_BINARY_DIR})