-
Notifications
You must be signed in to change notification settings - Fork 67
/
CMakeLists.txt
210 lines (182 loc) · 7.84 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
cmake_minimum_required(VERSION 3.14)
project(ARM2D)
option(ARM2D_HOST "Build for host" OFF)
option(ARM2D_HELPER "Build with helper support" OFF)
option(ARM2D_CMSIS_RTOS2 "Build with CMSIS-RTOS2 helper support" OFF)
option(ARM2D_RT_THREAD "Build with RT-Thread helper support" OFF)
option(ARM2D_LCD_PRINTF "Build with LCD printf support" OFF)
option(ARM2D_CONTROLS "Build with controls" OFF)
option(ARM2D_BENCHMARK_GENERIC "Build with generic benchmark support" OFF)
option(ARM2D_BENCHMARK_WATCHPANEL "Build with watchpanel benchmark support" OFF)
set(CMSISCORE "" CACHE STRING "Path to CMSIS Core")
add_library(ARM2D STATIC)
if (ARM2D_HOST)
target_compile_definitions(ARM2D PUBLIC HOST)
target_compile_options(ARM2D PUBLIC
-DARM_SECTION\(x\)=
-D__va_list=va_list
-fms-extensions)
target_compile_options(ARM2D PRIVATE -Wno-macro-redefined)
else()
target_include_directories(ARM2D PUBLIC ${CMSISCORE}/Include)
target_compile_options(ARM2D PRIVATE -Wno-nonnull-compare -Wno-unused-value)
target_compile_options(ARM2D PUBLIC -fms-extensions)
endif()
target_compile_options(ARM2D PUBLIC
-DRTE_Acceleration_Arm_2D
-DRTE_Acceleration_Arm_2D_Alpha_Blending
-DRTE_Acceleration_Arm_2D_Transform
-DRTE_Acceleration_Arm_2D_Filter
)
target_compile_options(ARM2D PRIVATE -Wno-format
-Wno-unused-function)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(ARM2D PRIVATE -Wno-maybe-uninitialized)
endif()
target_sources(ARM2D PRIVATE
Library/Source/arm_2d.c
Library/Source/arm_2d_async.c
Library/Source/arm_2d_draw.c
Library/Source/arm_2d_conversion.c
Library/Source/arm_2d_helium.c
Library/Source/arm_2d_alpha_blending.c
Library/Source/arm_2d_transform.c
Library/Source/arm_2d_filter.c
)
if (ARM2D_HELPER)
target_include_directories(ARM2D PUBLIC
Helper/Include/
Helper/built_in/)
target_sources(ARM2D PRIVATE
Helper/Source/arm_2d_helper.c
Helper/Source/arm_2d_helper_pfb.c
Helper/Source/arm_2d_helper_scene.c
Helper/Source/arm_2d_helper_list.c
Helper/Source/arm_2d_helper_shape.c
Helper/Source/arm_2d_helper_control.c
Helper/Source/WhiteDotSmall.c
Helper/Source/cmsis_logo.c
Helper/built_in/arm_2d_helper_built_in.c
Helper/built_in/busy_wheel.c
Helper/built_in/console_box.c
)
target_compile_options(ARM2D PUBLIC
-DRTE_Acceleration_Arm_2D_Helper_PFB
)
endif()
if (ARM2D_CMSIS_RTOS2)
target_sources(ARM2D PRIVATE Helper/Source/template/arm_2d_helper_rtos_cmsis_rtos2.c)
target_compile_options(ARM2D PUBLIC
-DRTE_Acceleration_Arm_2D_Helper_RTOS_CMSIS_RTOS2
)
endif()
if (ARM2D_RT_THREAD)
target_sources(ARM2D PRIVATE Helper/Source/template/arm_2d_helper_rtos_rt_thread.c)
target_compile_options(ARM2D PUBLIC
-DRTE_Acceleration_Arm_2D_Helper_RTOS_RT_Thread
)
endif()
if (ARM2D_LCD_PRINTF)
target_include_directories(ARM2D PUBLIC examples/common/controls/)
target_sources(ARM2D PRIVATE
Helper/Source/arm_2d_helper_font.c
Helper/Source/GLCD_Fonts.c
)
target_compile_options(ARM2D PUBLIC
-DRTE_Acceleration_Arm_2D_Extra_LCD_printf__
)
endif()
if (ARM2D_CONTROLS)
target_include_directories(ARM2D PUBLIC examples/common/controls/)
target_sources(ARM2D PRIVATE
examples/common/controls/controls.c
examples/common/controls/spinning_wheel.c
examples/common/controls/progress_bar_drill.c
examples/common/controls/progress_bar_flowing.c
examples/common/controls/progress_bar_simple.c
examples/common/controls/__simple_list.c
examples/common/controls/number_list.c
examples/common/controls/text_list.c
examples/common/controls/progress_wheel.c
examples/common/controls/list_view.c
examples/common/controls/battery_gasgauge.c
examples/common/controls/dynamic_nebula.c
examples/common/controls/histogram.c
examples/common/controls/spin_zoom_widget.c
examples/common/controls/cloudy_glass.c
examples/common/controls/meter_pointer.c
examples/common/asset/WhiteDotMiddle.c
examples/common/asset/WhiteDotBig.c
examples/common/asset/SpinWheel.c
examples/common/asset/blue_slashes.c
examples/common/asset/wave.c
examples/common/asset/GreenCircle.c
examples/common/asset/QuaterArcSmall.c
examples/common/asset/QuaterArcMiddle.c
examples/common/asset/QuaterArcBig.c
examples/common/asset/ListCover.c
examples/common/asset/battery_boarder_1.c
examples/common/asset/battery_gasgauge_block.c
examples/common/asset/battery_gasgauge_grade_boarder.c
examples/common/asset/SinWave.c
examples/common/asset/glass_reflection_wide.c
examples/common/asset/glass_reflection_narrow.c
examples/common/asset/Lighting.c
examples/common/asset/Pointer.c
examples/common/asset/watch_panel.c
examples/common/asset/pointer_sec.c
examples/common/asset/gear_01.c
examples/common/asset/gear_02.c
examples/common/asset/star.c
examples/common/asset/small_icon_sun.c
examples/common/asset/software.c
examples/common/asset/circle_mask.c
examples/common/asset/circle_small.c
examples/common/asset/wifi_signal.c
examples/common/asset/helium.c
examples/common/asset/background.c
examples/common/asset/BackgroundSmall.c
examples/common/asset/WatchCoverRound.c
examples/common/asset/GlassHalo.c
examples/common/asset/alarm_clock_font32.c
examples/common/asset/alarm_clock_font64.c
examples/common/asset/ECG.c
examples/common/asset/ECGScan.c
examples/common/asset/fan_blade.c
examples/common/asset/RadialGradient.c
examples/common/asset/GlassBall.c
examples/common/asset/HallowOutCircleMask.c
examples/common/asset/Fire8x4.c
examples/common/asset/DigitsFont.c
examples/common/asset/alarm_clock_font32.c
examples/common/asset/alarm_clock_font64.c
examples/common/asset/arial_ascii_font14.c
examples/common/asset/ClockMarking.c
)
target_compile_options(ARM2D PUBLIC
-DRTE_Acceleration_Arm_2D_Extra_Controls
)
endif()
if (ARM2D_BENCHMARK_GENERIC)
target_include_directories(ARM2D PUBLIC examples/common/benchmark/)
target_sources(ARM2D PRIVATE examples/common/benchmark/benchmark_generic.c
examples/common/benchmark/arm_2d_scene_benchmark_generic.c
examples/common/benchmark/arm_2d_scene_benchmark_generic_cover.c
)
target_compile_options(ARM2D PUBLIC
-DRTE_Acceleration_Arm_2D_Extra_Benchmark
-DRTE_Acceleration_Arm_2D_Extra_Benchmark_Generic
)
endif()
if (ARM2D_BENCHMARK_WATCHPANEL)
target_include_directories(ARM2D PUBLIC examples/common/benchmark/)
target_sources(ARM2D PRIVATE examples/common/benchmark/benchmark_watch_panel.c
examples/common/benchmark/arm_2d_scene_benchmark_watch_panel.c
examples/common/benchmark/arm_2d_scene_benchmark_watch_panel_cover.c
)
target_compile_options(ARM2D PUBLIC
-DRTE_Acceleration_Arm_2D_Extra_Benchmark
-DRTE_Acceleration_Arm_2D_Extra_Benchmark_Watch_Panel
)
endif()
target_include_directories(ARM2D PUBLIC Library/Include/)