@@ -34,26 +34,26 @@ set(CMSIS5_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMSIS_5" CACHE STRING "Path to CMSI
34
34
option (AUTODL_CMSIS OFF )
35
35
ensure_CMSIS(${CMSIS5_PATH} ${AUTODL_CMSIS} )
36
36
37
- add_library (core_config INTERFACE )
37
+ add_library (base_config INTERFACE )
38
38
39
39
if (${BUILD_RELPATH} )
40
- # $<TARGET_PROPERTY:SOURCE_DIR> is evaluated by the final consumer, no core_config
41
- target_compile_options (core_config INTERFACE
40
+ # $<TARGET_PROPERTY:SOURCE_DIR> is evaluated by the final consumer, no base_config
41
+ target_compile_options (base_config INTERFACE
42
42
"-fmacro-prefix-map=$<TARGET_PROPERTY:SOURCE_DIR>=."
43
43
)
44
44
endif ()
45
45
46
46
if (${BUILD_NDEBUG} )
47
- add_compile_definitions (core_config INTERFACE NDEBUG)
47
+ add_compile_definitions (base_config INTERFACE NDEBUG)
48
48
endif ()
49
49
50
50
# configuration specifics
51
51
if (${FEAT_XSERIAL} STREQUAL "GENERIC" )
52
- target_compile_definitions (core_config INTERFACE
52
+ target_compile_definitions (base_config INTERFACE
53
53
HAL_UART_MODULE_ENABLED
54
54
)
55
55
elseif (${FEAT_XSERIAL} STREQUAL "NONE" )
56
- target_compile_definitions (core_config INTERFACE
56
+ target_compile_definitions (base_config INTERFACE
57
57
HAL_UART_MODULE_ENABLED
58
58
HWSERIAL_NONE
59
59
)
@@ -78,7 +78,7 @@ endif()
78
78
if (${FEAT_USB} STREQUAL "NONE" )
79
79
#nothing
80
80
elseif (${FEAT_USB} STREQUAL "CDCGEN" )
81
- target_compile_definitions (core_config INTERFACE
81
+ target_compile_definitions (base_config INTERFACE
82
82
USBCON
83
83
${USB_SPEED}
84
84
USBD_VID=${USB_VID}
@@ -87,7 +87,7 @@ elseif (${FEAT_USB} STREQUAL "CDCGEN")
87
87
USBD_USE_CDC
88
88
)
89
89
elseif (${FEAT_USB} STREQUAL "CDC" )
90
- target_compile_definitions (core_config INTERFACE
90
+ target_compile_definitions (base_config INTERFACE
91
91
USBCON
92
92
${USB_SPEED}
93
93
USBD_VID=${USB_VID}
@@ -97,7 +97,7 @@ elseif (${FEAT_USB} STREQUAL "CDC")
97
97
DISABLE_GENERIC_SERIALUSB
98
98
)
99
99
elseif (${FEAT_USB} STREQUAL "HID" )
100
- target_compile_definitions (core_config INTERFACE
100
+ target_compile_definitions (base_config INTERFACE
101
101
USBCON
102
102
${USB_SPEED}
103
103
USBD_VID=${USB_VID}
@@ -110,16 +110,16 @@ else()
110
110
endif ()
111
111
112
112
if (${FEAT_NANOC} )
113
- target_link_options (core_config INTERFACE
113
+ target_link_options (base_config INTERFACE
114
114
"--specs=nano.specs"
115
115
)
116
116
if (${FEAT_FPF} )
117
- target_link_options (core_config INTERFACE
117
+ target_link_options (base_config INTERFACE
118
118
"SHELL:-u _printf_float"
119
119
)
120
120
endif ()
121
121
if (${FEAT_FSF} )
122
- target_link_options (core_config INTERFACE
122
+ target_link_options (base_config INTERFACE
123
123
"SHELL:-u _scanf_float"
124
124
)
125
125
endif ()
@@ -128,22 +128,22 @@ endif()
128
128
if (${FEAT_VIRTIO} STREQUAL "DISABLED" )
129
129
# nothing
130
130
elseif (${FEAT_VIRTIO} STREQUAL "GENERIC" )
131
- target_compile_definitions (core_config INTERFACE
131
+ target_compile_definitions (base_config INTERFACE
132
132
VIRTIOCON
133
133
NO_ATOMIC_64_SUPPORT
134
134
METAL_INTERNAL
135
135
METAL_MAX_DEVICE_REGIONS=2
136
136
VIRTIO_SLAVE_ONLY
137
137
VIRTIO_LOG
138
138
)
139
- target_include_directories (core_config INTERFACE
139
+ target_include_directories (base_config INTERFACE
140
140
${BUILD_SYSTEM_PATH} /Middlewares/OpenAMP
141
141
${BUILD_SYSTEM_PATH} /Middlewares/OpenAMP/open-amp/lib/include
142
142
${BUILD_SYSTEM_PATH} /Middlewares/OpenAMP/libmetal/lib/include
143
143
${BUILD_SYSTEM_PATH} /Middlewares/OpenAMP/virtual_driver
144
144
)
145
145
elseif (${FEAT_VIRTIO} STREQUAL "ENABLED" )
146
- target_compile_definitions (core_config INTERFACE
146
+ target_compile_definitions (base_config INTERFACE
147
147
VIRTIOCON
148
148
NO_ATOMIC_64_SUPPORT
149
149
METAL_INTERNAL
@@ -152,7 +152,7 @@ elseif (${FEAT_VIRTIO} STREQUAL "ENABLED")
152
152
VIRTIO_LOG
153
153
DISABLE_GENERIC_SERIALVIRTIO
154
154
)
155
- target_include_directories (core_config INTERFACE
155
+ target_include_directories (base_config INTERFACE
156
156
${BUILD_SYSTEM_PATH} /Middlewares/OpenAMP
157
157
${BUILD_SYSTEM_PATH} /Middlewares/OpenAMP/open-amp/lib/include
158
158
${BUILD_SYSTEM_PATH} /Middlewares/OpenAMP/libmetal/lib/include
@@ -163,48 +163,70 @@ else()
163
163
endif ()
164
164
165
165
if (${FEAT_TIMER} )
166
- target_compile_definitions (core_config INTERFACE
166
+ target_compile_definitions (base_config INTERFACE
167
167
HAL_TIM_MODULE_ENABLE
168
168
)
169
169
else ()
170
170
# triggers a user-directed warning
171
- target_compile_definitions (core_config INTERFACE
171
+ target_compile_definitions (base_config INTERFACE
172
172
HAL_TIM_MODULE_DISABLED
173
173
)
174
174
endif ()
175
175
176
176
if (${BUILD_OPT} MATCHES "^[0-3gs]$" )
177
- target_compile_options (core_config INTERFACE
177
+ target_compile_options (base_config INTERFACE
178
178
-O${BUILD_OPT}
179
179
)
180
180
else ()
181
181
message (SEND_ERROR "Bad value for BUILD_OPT: got `${BUILD_OPT} `, expected one of 0123gs." )
182
182
endif ()
183
183
184
184
if (${BUILD_DBG} )
185
- target_compile_options (core_config INTERFACE
185
+ target_compile_options (base_config INTERFACE
186
186
-g
187
187
)
188
188
endif ()
189
189
190
190
if (${BUILD_LTO} )
191
- target_compile_options (core_config INTERFACE
191
+ target_compile_options (base_config INTERFACE
192
192
-flto
193
193
)
194
- target_link_options (core_config INTERFACE
194
+ target_link_options (base_config INTERFACE
195
195
-flto
196
196
)
197
197
endif ()
198
198
199
199
# generic compilation options
200
- target_link_libraries (core_config INTERFACE board)
201
- target_link_options (core_config INTERFACE
200
+ target_link_libraries (base_config INTERFACE board)
201
+ target_compile_definitions (base_config INTERFACE
202
+ USE_FULL_LL_DRIVER
203
+ ARDUINO_ARCH_STM32
204
+ )
205
+ target_compile_options (base_config INTERFACE
206
+ -mthumb
207
+ --param max-inline-insns-single=500
208
+ $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
209
+ $<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
210
+ $<$<COMPILE_LANGUAGE:CXX>:-fno-use-cxa-atexit>
211
+ $<$<COMPILE_LANGUAGE:CXX>:-fno-threadsafe-statics>
212
+ -ffunction-sections
213
+ -fdata-sections
214
+ )
215
+
216
+ target_link_options (base_config INTERFACE
217
+ -mthumb
218
+ LINKER:--cref
219
+ LINKER:--check-sections
220
+ LINKER:--gc-sections
221
+ LINKER:--entry=Reset_Handler
222
+ LINKER:--unresolved-symbols=report-all
223
+ LINKER:--warn-common
202
224
LINKER:--script=${BUILD_SYSTEM_PATH} /ldscript.ld
203
225
)
204
- target_link_directories (core_config INTERFACE
226
+ target_link_directories (base_config INTERFACE
205
227
"${CMSIS5_PATH} /CMSIS/DSP/Lib/GCC"
206
228
)
207
- target_include_directories (core_config INTERFACE
229
+ target_include_directories (base_config INTERFACE
208
230
"${BUILD_CORE_PATH} "
209
231
"${BUILD_CORE_PATH} /avr"
210
232
"${BUILD_CORE_PATH} /stm32"
@@ -235,7 +257,7 @@ target_link_libraries(stm32_runtime INTERFACE
235
257
# but SrcWrapper is an object library, not an archive, so it isn't necessary
236
258
# (this means the linker takes all the object unconditionally, as opposed to an archive where it picks what it needs)
237
259
# note: SrcWrapper in particular MUST be an object library, due to possible weak+strong symbols (cf. library.properties)
238
- core_config
260
+ base_config
239
261
240
262
SrcWrapper
241
263
core
0 commit comments