Skip to content

Commit 498a46f

Browse files
authored
added option for Sanitize (#479)
1 parent b412384 commit 498a46f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ if(DEBUG)
1919
)
2020
endif(DEBUG)
2121

22+
option(SANITIZE "Enable Sanitize" OFF)
23+
if(SANITIZE)
24+
add_compile_options(
25+
-fsanitize=address
26+
-fsanitize=leak
27+
)
28+
add_link_options(
29+
-fsanitize=address
30+
-fsanitize=leak
31+
)
32+
endif(SANITIZE)
33+
2234
# set up CPM.cmake
2335
if(CPM_SOURCE_CACHE)
2436
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM.cmake")

0 commit comments

Comments
 (0)