New central module FindSanitizers.cmake.

* Added a new module FindSanitizers with new function add_sanitizers to combine
  all sanitizers in one function instead of adding each one by one.
* Code of FindASan.cmake was outdourced into helper functions, so that the code
  may be used by other sanitizer modules, too.
* AddressSanitizer will be used with -O1 now to get a better performance.
This commit is contained in:
Alexander Haase
2016-04-06 18:41:24 +02:00
parent 8f2015a4d3
commit b492553f61
4 changed files with 145 additions and 95 deletions

View File

@ -31,6 +31,7 @@ function(add_testcase TESTNAME SOURCEFILES)
# add a new executable
add_executable(${TESTNAME} ${ARGV})
add_sanitizers(${TESTNAME})
# add a testcase for executable
add_test(${TESTNAME} ${TESTNAME})
@ -41,10 +42,7 @@ endfunction(add_testcase)
#
# search for sanitizers
#
find_package(ASan)
find_package(MSan)
find_package(TSan)
find_package(UBSan)
find_package(Sanitizers)