From 47cc77f0e5277ac609ac03cee8299a986183f96f Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Tue, 22 Mar 2022 12:30:10 +0100 Subject: [PATCH] Add support for AddressSanitizer to unit tests --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4895eb2..d60b6e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,4 +125,6 @@ if (CREATURELIB_TESTS) # Add a definition for the test library target_compile_definitions(CreatureLibTests PRIVATE TESTS_BUILD) + target_compile_options(CreatureLibTests PRIVATE -fsanitize=address) + target_link_options(CreatureLibTests PRIVATE -fsanitize=address) endif ()