@@ -235,34 +235,31 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
235
235
236
236
# This method must be called from the project scope to suppress known warnings in TinyUSB source files
237
237
function (suppress_tinyusb_warnings )
238
- # some of these are pretty silly warnings only occurring in some older GCC versions
239
- set (CONVERSION_WARNING_FILES
240
- ${PICO_TINYUSB_PATH} /src/tusb.c
241
- ${PICO_TINYUSB_PATH} /src/common/tusb_fifo.c
242
- ${PICO_TINYUSB_PATH} /src/device/usbd.c
243
- ${PICO_TINYUSB_PATH} /src/device/usbd_control.c
244
- ${PICO_TINYUSB_PATH} /src/host/usbh.c
245
- ${PICO_TINYUSB_PATH} /src/class/cdc/cdc_device.c
246
- ${PICO_TINYUSB_PATH} /src/class/cdc/cdc_host.c
247
- ${PICO_TINYUSB_PATH} /src/class/hid/hid_device.c
248
- ${PICO_TINYUSB_PATH} /src/class/hid/hid_host.c
249
- ${PICO_TINYUSB_PATH} /src/class/audio/audio_device.c
250
- ${PICO_TINYUSB_PATH} /src/class/dfu/dfu_device.c
251
- ${PICO_TINYUSB_PATH} /src/class/dfu/dfu_rt_device.c
252
- ${PICO_TINYUSB_PATH} /src/class/midi/midi_device.c
253
- ${PICO_TINYUSB_PATH} /src/class/usbtmc/usbtmc_device.c
254
- ${PICO_TINYUSB_PATH} /src/portable/raspberrypi/rp2040/hcd_rp2040.c
255
- )
256
- foreach (SOURCE_FILE IN LISTS CONVERSION_WARNING_FILES )
257
- set_source_files_properties (
258
- ${SOURCE_FILE}
259
- PROPERTIES
260
- COMPILE_FLAGS "-Wno-conversion" )
261
- endforeach ()
262
- set_source_files_properties (
263
- ${PICO_TINYUSB_PATH} /src/portable/raspberrypi/rp2040/rp2040_usb.c
264
- PROPERTIES
265
- COMPILE_FLAGS "-Wno-stringop-overflow -Wno-array-bounds"
266
- )
238
+ # some of these are pretty silly warnings only occurring in some older GCC versions 9 or prior
239
+ if (CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0 )
240
+ set (CONVERSION_WARNING_FILES
241
+ ${PICO_TINYUSB_PATH} /src/tusb.c
242
+ ${PICO_TINYUSB_PATH} /src/common/tusb_fifo.c
243
+ ${PICO_TINYUSB_PATH} /src/device/usbd.c
244
+ ${PICO_TINYUSB_PATH} /src/device/usbd_control.c
245
+ ${PICO_TINYUSB_PATH} /src/host/usbh.c
246
+ ${PICO_TINYUSB_PATH} /src/class/cdc/cdc_device.c
247
+ ${PICO_TINYUSB_PATH} /src/class/cdc/cdc_host.c
248
+ ${PICO_TINYUSB_PATH} /src/class/hid/hid_device.c
249
+ ${PICO_TINYUSB_PATH} /src/class/hid/hid_host.c
250
+ ${PICO_TINYUSB_PATH} /src/class/audio/audio_device.c
251
+ ${PICO_TINYUSB_PATH} /src/class/dfu/dfu_device.c
252
+ ${PICO_TINYUSB_PATH} /src/class/dfu/dfu_rt_device.c
253
+ ${PICO_TINYUSB_PATH} /src/class/midi/midi_device.c
254
+ ${PICO_TINYUSB_PATH} /src/class/usbtmc/usbtmc_device.c
255
+ ${PICO_TINYUSB_PATH} /src/portable/raspberrypi/rp2040/hcd_rp2040.c
256
+ )
257
+ foreach (SOURCE_FILE IN LISTS CONVERSION_WARNING_FILES )
258
+ set_source_files_properties (
259
+ ${SOURCE_FILE}
260
+ PROPERTIES
261
+ COMPILE_FLAGS "-Wno-conversion" )
262
+ endforeach ()
263
+ endif ()
267
264
endfunction ()
268
265
endif ()
0 commit comments