Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #45 from marcinslusarz/sanitizers
Browse files Browse the repository at this point in the history
cmake: s/SANITIZERS_ENABLED/SANITIZERS/g and document SANITIZERS
  • Loading branch information
marcinslusarz committed Mar 20, 2017
2 parents fb48b6e + 6d49acf commit d78bb01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ add_cxx_flag(-DDEBUG DEBUG)
add_c_flag("-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" RELEASE C_CAN_FORTIFY)
add_cxx_flag("-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" RELEASE CXX_CAN_FORTIFY)

option(SANITIZERS_ENABLED "enable AddressSanitizer and UndefinedBehaviorSanitizer (debugging)" OFF)
option(SANITIZERS "enable AddressSanitizer and UndefinedBehaviorSanitizer (debugging)" OFF)

if(SANITIZERS_ENABLED)
if(SANITIZERS)
if(BUILD_LIBPMEMFILE)
message(FATAL_ERROR "Sanitizers are incompatible with LIBPMEMFILE. If you want to test LIBPMEMFILE-POSIX with SANITIZERS_ENABLED define BUILD_LIBPMEMFILE to 0/OFF.")
message(FATAL_ERROR "Sanitizers are incompatible with LIBPMEMFILE. If you want to test LIBPMEMFILE-POSIX with SANITIZERS define BUILD_LIBPMEMFILE to 0/OFF.")
endif()

set(SAVED_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ $ ctest --output-on-failure
Note that in Debug mode "make install" installs only debug libraries.

Pmemfile-specific cmake variables:
```
* BUILD_LIBPMEMFILE=0 - disables building of libpmemfile.so
* DEVELOPER_MODE=1 - enables coding style, whitespace, license checks and enables fail-on-warning flags
* LONG_TESTS=1 - enables tests which take much more time
* TEST_DIR=/mnt/pmem/test_dir - provides directory where tests will create its pools
* TRACE_TESTS=1 - dumps more info when test fails (requires cmake >= 3.4)
* TESTS_USE_FORCED_PMEM=1 - allows tests to force enable or force disable use of optimized flush in libpmemobj (to speed them up)
```
* SANITIZERS=1 - enables AddressSanitizer and UndefinedBehaviorSanitizer (only for debugging)

# Package for Debian-based distros
```sh
Expand Down
2 changes: 1 addition & 1 deletion tests/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function(add_test_generic name tracer)
endif()
endif()

if (SANITIZERS_ENABLED AND ${tracer} IN_LIST vg_tracers)
if (SANITIZERS AND ${tracer} IN_LIST vg_tracers)
return()
endif()

Expand Down

0 comments on commit d78bb01

Please sign in to comment.