mirror of
https://github.com/Z3Prover/z3
synced 2025-04-03 16:19:57 +00:00
add cmake option to turn on asan
This commit is contained in:
parent
a8279dd9d5
commit
fd5f5feb40
|
@ -300,6 +300,16 @@ list(APPEND Z3_DEPENDENT_LIBS Threads::Threads)
|
|||
################################################################################
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/compiler_warnings.cmake)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Address sanitization
|
||||
################################################################################
|
||||
option(Z3_ADDRESS_SANITIZE "Set address sanitization." OFF)
|
||||
|
||||
if (Z3_ADDRESS_SANITIZE)
|
||||
z3_add_cxx_flag("-fsanitize=address" REQUIRED)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Save Clang optimization records
|
||||
################################################################################
|
||||
|
|
|
@ -311,6 +311,7 @@ The following useful options can be passed to CMake whilst configuring.
|
|||
* ``Z3_SAVE_CLANG_OPTIMIZATION_RECORDS`` - BOOL. If set to ``TRUE`` saves Clang optimization records by setting the compiler flag ``-fsave-optimization-record``.
|
||||
* ``Z3_SINGLE_THREADED`` - BOOL. If set to ``TRUE`` compiles Z3 for single threaded mode.
|
||||
* ``Z3_POLLING_TIMER`` - BOOL. If set to ``TRUE`` compiles Z3 to use polling based timer instead of requiring a thread. This is useful for wasm builds and avoids spawning threads that interfere with how WASM is run.
|
||||
* ``Z3_ADDRESS_SANITIZE`` - BOOL. If set to ``TRUE`` compiles Z3 with address sanitization enabled.
|
||||
|
||||
|
||||
On the command line these can be passed to ``cmake`` using the ``-D`` option. In ``ccmake`` and ``cmake-gui`` these can be set in the user interface.
|
||||
|
|
Loading…
Reference in a new issue