From 1ff1f0e3c26e40a92d56630a092d65fac9655b64 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sun, 24 Nov 2024 23:39:24 -0700 Subject: build-sys: Add ubsan to host builds --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') 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() -- cgit v1.2.3-2-g168b