-
Notifications
You must be signed in to change notification settings - Fork 65
/
compile-flags.cmake
55 lines (50 loc) · 1.34 KB
/
compile-flags.cmake
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
add_compile_flags(LD
-nostartfiles
-static
-Wl,--gc-sections
-Wl,-static
-Wl,--start-group
-Wl,--whole-archive
-Wl,--no-whole-archive
-Wl,--end-group
-Wl,-EL
"-T \"${SDK_ROOT}/lds/kendryte.ld\""
)
# C Flags Settings
add_compile_flags(BOTH
-mcmodel=medany
-mabi=lp64f
-march=rv64imafc
-fno-common
-ffunction-sections
-fdata-sections
-fstrict-volatile-bitfields
-ffast-math
-fno-math-errno
-fsingle-precision-constant
-O2
-ggdb
)
add_compile_flags(C -std=gnu11)
add_compile_flags(CXX -std=gnu++17)
if (BUILDING_SDK)
add_compile_flags(BOTH
-Wall
-Werror=all
-Wno-error=unused-function
-Wno-error=unused-but-set-variable
-Wno-error=unused-variable
-Wno-error=deprecated-declarations
-Wno-error=maybe-uninitialized
-Wextra
-Werror=frame-larger-than=65536
-Wno-unused-parameter
-Wno-unused-function
-Wno-implicit-fallthrough
-Wno-sign-compare
-Wno-error=missing-braces
)
add_compile_flags(C -Wno-old-style-declaration)
else ()
add_compile_flags(BOTH -L"${SDK_ROOT}/include/")
endif ()