-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
61 lines (50 loc) · 1.9 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
51
52
53
54
55
56
57
58
59
60
61
#THIS FILE IS AUTO GENERATED FROM THE TEMPLATE! DO NOT CHANGE!
set(CMAKE_SYSTEM_NAME ERG-Project)
set(CMAKE_SYSTEM_VERSION 1)
cmake_minimum_required(VERSION 3.17)
#引用ARMClang_Cortex-M4.cmake
include(ARMGcc_Cortex-M4.cmake)
CMSIS_EnableFPU(TRUE)
#设置Sections脚本路径
CMSIS_SetSectionsScriptPath(${CMAKE_HOME_DIRECTORY}/STM32G431VBTx_FLASH.ld)
CMSIS_CrossCompilingConfiguration()
# project settings
project(ERG26_G4 C CXX ASM)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
message(STATUS "Maximum optimization for speed")
add_compile_options(-Ofast)
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
message(STATUS "Maximum optimization for speed, debug info included")
# add_compile_definitions(SYSVIEW_DEBUG)
add_compile_options(-Ofast -g)
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
message(STATUS "Maximum optimization for size")
add_compile_options(-Os)
else ()
message(STATUS "Minimal optimization, debug info included")
add_compile_definitions(SYSVIEW_DEBUG)
add_compile_options(-Og -g -gdwarf-2)
endif ()
include_directories(APP/
MotorControl/
Board/ERG26/Inc
Board/ERG26/EEPROM_Emul/Core/
Board/ERG26/EEPROM_Emul/Porting/STM32G4
ThirdParty/TinyFrame
ThirdParty/SystemViewer
ThirdParty/STM32G4xx_HAL_Driver/Inc
ThirdParty/STM32G4xx_HAL_Driver/Inc/Legacy
ThirdParty/CMSIS/DSP/Include
ThirdParty/CMSIS/Device/ST/STM32G4xx/Include
ThirdParty/CMSIS/Include)
add_definitions(-DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32G431xx)
file(GLOB_RECURSE SOURCES
"App/*.*"
"Board/*.*"
"ThirdParty/*.*"
"MotorControl/*.*"
"${STARTUP_FILE}")
CMSIS_CompileELF()
CMSIS_CompileHex()