diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-04 09:30:42 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-04 09:30:42 -0500 |
commit | 83a0b4cebcdcc0c8cf6f3f28c304140a7fc2dcd6 (patch) | |
tree | 1dc9e944a805e4cb2d58ca21edd7c9a89761ed49 | |
parent | 6e4c1b84adae268691de27a204ecd8beabd753e6 (diff) | |
download | stasis-83a0b4cebcdcc0c8cf6f3f28c304140a7fc2dcd6.tar.gz |
Add a cmake option to enable the address sanitizer
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d21a553..76b7186 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,13 @@ set(win_cflags /Wall) set(CMAKE_C_STANDARD 99) find_package(LibXml2) find_package(CURL) + +option(ASAN OFF) +if (ASAN) + add_compile_options(-fsanitize=address) + add_link_options(-fsanitize=address) +endif() + link_libraries(CURL::libcurl) link_libraries(LibXml2::LibXml2) include_directories(${LIBXML2_INCLUDE_DIR}) |