-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (37 loc) · 1.18 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
cmake_minimum_required(VERSION 3.16)
project(tc39x C)
set(CMAKE_C_FLAGS "\
-mtc162 \
-Wall \
-g \
-Wpointer-arith \
-Wshadow -Wfloat-equal -Wno-unused-local-typedefs -Wextra -fno-common \
-fstrict-volatile-bitfields -ffunction-sections -fdata-sections"
)
set(CMAKE_CXX_FLAGS "\
-mtc162 -Wall -Wpointer-arith -Wshadow -Wfloat-equal \
-Wno-unused-local-typedefs -Wextra -fno-common -fstrict-volatile-bitfields \
-ffunction-sections -fdata-sections"
)
set(CMAKE_EXE_LINKER_FLAGS "\
-nostartfiles -mtc162 -Wl,--gc-sections -Wl,--extmap=a -Wl,-n \
-Wl,-T ${CMAKE_SOURCE_DIR}/Lcf_Gnuc_Tricore_Tc.lsl"
)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_program(OBJDUMP_BIN NAMES tricore-objcopy tricore-elf-objcopy REQUIRED)
# Add custom command to generate the .hex file
# create a custom target to build it
function(create_hex target)
add_custom_target(${target}_hex
ALL
COMMAND ${OBJDUMP_BIN} ${target}.elf -O ihex ${target}.hex
DEPENDS ${target}
COMMENT "Generating ${target}.hex"
VERBATIM
)
endfunction()
add_subdirectory(Libraries)
add_subdirectory(Configurations)
# Start adding each examples
add_subdirectory(blinky)
add_subdirectory(multicore)