aboutsummaryrefslogtreecommitdiff
path: root/cmake/compiler/gcc/settings.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/compiler/gcc/settings.cmake')
-rw-r--r--cmake/compiler/gcc/settings.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake
index 9139a028f18..b2d427ecbeb 100644
--- a/cmake/compiler/gcc/settings.cmake
+++ b/cmake/compiler/gcc/settings.cmake
@@ -44,6 +44,24 @@ if( WITH_COREDEBUG )
message(STATUS "GCC: Debug-flags set (-g3)")
endif()
+if(ASAN)
+ target_compile_options(trinity-compile-option-interface
+ INTERFACE
+ -fno-omit-frame-pointer
+ -fsanitize=address
+ -fsanitize-recover=address
+ -fsanitize-address-use-after-scope)
+
+ target_link_options(trinity-compile-option-interface
+ INTERFACE
+ -fno-omit-frame-pointer
+ -fsanitize=address
+ -fsanitize-recover=address
+ -fsanitize-address-use-after-scope)
+
+ message(STATUS "GCC: Enabled Address Sanitizer")
+endif()
+
if (BUILD_SHARED_LIBS)
target_compile_options(trinity-compile-option-interface
INTERFACE