File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,14 @@ cmake_minimum_required(VERSION 3.12)
88
99option (JAM_COMPATIBLE "Build compatible with JAM-codec" OFF )
1010option (CUSTOM_CONFIG_SUPPORT "Support custom config of coder" OFF )
11- set (MAX_AGGREGATE_FIELDS 20 CACHE STRING "Max number of aggregates fields (1..1000); for generation" )
12-
1311option (BUILD_TESTS "Whether to include the test suite in build" OFF )
1412
13+ option (SCALE_ASAN "Build with address sanitizer" OFF )
14+ option (SCALE_UBSAN "Build with undefined behavior sanitizer" OFF )
15+ option (SCALE_TSAN "Build with thread sanitizer" OFF )
16+
17+ set (MAX_AGGREGATE_FIELDS 20 CACHE STRING "Max number of aggregates fields (1..1000); for generation" )
18+
1519if (PACKAGE_MANAGER)
1620 if (PACKAGE_MANAGER NOT MATCHES "^(hunter|vcpkg)$" )
1721 message (FATAL_ERROR "PACKAGE_MANAGER must be set to 'hunter', 'vcpkg' or isn't set" )
@@ -66,6 +70,19 @@ SET(JAM_COMPATIBILITY_ENABLED "${JAM_COMPATIBLE}")
6670set (CUSTOM_CONFIG_ENABLED "${CUSTOM_CONFIG_SUPPORT} " )
6771configure_file ("${CMAKE_SOURCE_DIR} /include/scale/definitions.hpp.in" "${CMAKE_BINARY_DIR} /include/scale/definitions.hpp" )
6872
73+ if (SCALE_ASAN)
74+ add_compile_options (-fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer)
75+ add_link_options (-fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer)
76+ endif ()
77+ if (SCALE_UBSAN)
78+ add_compile_options (-fsanitize=undefined -fno-omit-frame-pointer)
79+ add_link_options (-fsanitize=undefined -fno-omit-frame-pointer)
80+ endif ()
81+ if (SCALE_TSAN)
82+ add_compile_options (-fsanitize=thread -fno-omit-frame-pointer)
83+ add_link_options (-fsanitize=thread -fno-omit-frame-pointer)
84+ endif ()
85+
6986add_subdirectory (src)
7087
7188if (BUILD_TESTS)
You can’t perform that action at this time.
0 commit comments