summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
author[email protected] <[email protected]>2018-03-14 00:13:23 +0100
committer[email protected] <[email protected]>2018-03-14 00:13:23 +0100
commit82491fcf6c70288652449f4ddeb8bdbe9628dd81 (patch)
tree440e6a5658a46fb8bc77bbdc36bbe4727bcf99a4
parent85850a955a1c3d6e51f919385679ea9ba4d6a864 (diff)
downloadraylib-82491fcf6c70288652449f4ddeb8bdbe9628dd81.tar.gz
raylib-82491fcf6c70288652449f4ddeb8bdbe9628dd81.zip
Add memory sanitizer for better debug
-rwxr-xr-xCMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d98ffea..84977abb 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,7 @@ option(BUILD_EXAMPLES "Build the examples." ON)
option(BUILD_GAMES "Build the example games." ON)
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
+option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended for run with ASAN)" OFF)
if(CMAKE_VERSION VERSION_LESS "3.1")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
@@ -40,6 +41,10 @@ if (ENABLE_UBSAN)
add_if_flag_works(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_works(-fsanitize=undefined CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
endif()
+if (ENABLE_MSAN)
+ add_if_flag_works(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
+ add_if_flag_works(-fsanitize=memory CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
+endif()
add_subdirectory(src release)