summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-11 14:08:56 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-11 19:19:48 -0700
commit9f6f267cc4acb6c72872e42593ca701df1f5fdc3 (patch)
treefb01515d0a7e3801ed29380575b5b9f6216a1607
parent6ae2bbf849aa597054d7c84d20fc634ed87a1da5 (diff)
build-sys: Add -Wswitch-enum
-rw-r--r--CMakeLists.txt10
-rw-r--r--cmd/sbc_harness/CMakeLists.txt2
2 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 100214c..c9774c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,15 @@ project(sbc_harness)
pico_sdk_init()
-add_compile_options(-Wall -Wextra -Werror)
+add_compile_options(-Wall -Wextra -Wswitch-enum -Werror)
+
+function(_suppress_tinyusb_warnings)
+ __suppress_tinyusb_warnings()
+ set_source_files_properties(
+ ${PICO_TINYUSB_PATH}/src/device/usbd.c
+ PROPERTIES
+ COMPILE_OPTIONS "-Wno-switch-enum")
+endfunction()
function(target_embed_sources arg_target arg_hdrname)
set(embed_objs)
diff --git a/cmd/sbc_harness/CMakeLists.txt b/cmd/sbc_harness/CMakeLists.txt
index 2018cf7..fb8fc4b 100644
--- a/cmd/sbc_harness/CMakeLists.txt
+++ b/cmd/sbc_harness/CMakeLists.txt
@@ -27,6 +27,8 @@ pico_enable_stdio_uart(sbc_harness_objs 1)
pico_enable_stdio_semihosting(sbc_harness_objs 0)
pico_enable_stdio_rtt(sbc_harness_objs 0)
+suppress_tinyusb_warnings()
+
# Analyze the stack ############################################################
add_stack_analysis(sbc_harness_stack.c sbc_harness_objs)