Add basic sanitizer support to CMake

This commit is contained in:
Karol Babioch 2018-02-28 17:37:58 +01:00
parent 564fbfb678
commit 735eba9474
3 changed files with 9 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "externals/sanitizers-cmake"]
path = externals/sanitizers-cmake
url = git://github.com/arsenm/sanitizers-cmake.git

View File

@ -71,6 +71,7 @@ set(OPENJPEG_LIBRARY_PROPERTIES
# Path to additional CMake modules
set(CMAKE_MODULE_PATH
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/externals/sanitizers-cmake/cmake
${CMAKE_MODULE_PATH})
# --------------------------------------------------------------------------
@ -243,6 +244,10 @@ check_symbol_exists(posix_memalign stdlib.h OPJ_HAVE_POSIX_MEMALIGN)
unset(CMAKE_REQUIRED_DEFINITIONS)
# memalign (obsolete)
check_symbol_exists(memalign malloc.h OPJ_HAVE_MEMALIGN)
# Make sure there is Sanitizer support in CMake
find_package(Sanitizers)
#-----------------------------------------------------------------------------
# Build Library
if(BUILD_JPIP_SERVER)

1
externals/sanitizers-cmake vendored Submodule

@ -0,0 +1 @@
Subproject commit 6947cff3a9c9305eb9c16135dd81da3feb4bf87f