Skip to content

Commit

Permalink
Enable sanitizers for GCC too
Browse files Browse the repository at this point in the history
  • Loading branch information
snej committed Sep 14, 2024
1 parent fa9dad4 commit 1d0f53f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/platform_unix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function(setup_litecore_build_unix)
endif()


if (LITECORE_SANITIZE AND NOT CODE_COVERAGE_ENABLED AND (CMAKE_CXX_COMPILER_ID MATCHES Clang))
if (LITECORE_SANITIZE AND NOT CODE_COVERAGE_ENABLED AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
set(LITECORE_COMPILE_OPTIONS
-fstack-protector
-fsanitize=address
Expand All @@ -67,6 +67,11 @@ function(setup_litecore_build_unix)
-fsanitize=address
-fsanitize=undefined
)
# if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
# target_link_options(${target} PRIVATE
# -static-libasan
# )
# endif ()
endforeach ()
else()
set(LITECORE_COMPILE_OPTIONS
Expand Down Expand Up @@ -105,7 +110,7 @@ function(setup_litecore_build_unix)
)

if(LITECORE_WARNINGS_HARDCORE)
if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(LITECORE_CXX_WARNINGS
-Werror
-Weverything # "WARN ALL THE THINGS!!!"
Expand Down

0 comments on commit 1d0f53f

Please sign in to comment.