From 83cd1da1efdd41680e3f1fda1cb6d493d4aa8dad Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Mon, 25 Oct 2021 08:56:25 -0500 Subject: [PATCH] fix build if TinyUSB not present (#631) --- test/kitchen_sink/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/kitchen_sink/CMakeLists.txt b/test/kitchen_sink/CMakeLists.txt index 52067b8..024d42c 100644 --- a/test/kitchen_sink/CMakeLists.txt +++ b/test/kitchen_sink/CMakeLists.txt @@ -97,7 +97,12 @@ pico_set_program_name(kitchen_sink "Wombat tentacles") pico_add_extra_outputs(kitchen_sink) add_executable(kitchen_sink_extra_stdio) -suppress_tinyusb_warnings() # suppress warnings explicitly in TinyUSB files which have them +if (COMMAND suppress_tinyusb_warnings) + # Explicitly suppress warnings in TinyUSB files which have them (this has to be done + # from the project that uses them per CMake "feature"). Note the function comes from + # TinyUSB itself, so we have to guard against TinyUSB not being present with the above if + suppress_tinyusb_warnings() +endif() target_link_libraries(kitchen_sink_extra_stdio kitchen_sink_libs kitchen_sink_options) pico_add_extra_outputs(kitchen_sink_extra_stdio) pico_enable_stdio_usb(kitchen_sink_extra_stdio 1)