summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-24 23:39:24 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-24 23:45:35 -0700
commit1ff1f0e3c26e40a92d56630a092d65fac9655b64 (patch)
treeca3ff7291ebb2d0959b71fcc8a072123d47f2a6e
parent61019e5f90491f276acd3120b08f664b641b233f (diff)
build-sys: Add ubsan to host builds
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eef2617..4bffff9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,10 @@ project(sbc_harness)
pico_sdk_init()
add_compile_options(-Wall -Wextra -Wswitch-enum -Werror)
+if (PICO_PLATFORM STREQUAL "host")
+ add_compile_options(-fsanitize=undefined)
+ add_link_options(-fsanitize=undefined)
+endif()
function(_suppress_tinyusb_warnings)
__suppress_tinyusb_warnings()