diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..b49debd1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "externals/sanitizers-cmake"] + path = externals/sanitizers-cmake + url = git://github.com/arsenm/sanitizers-cmake.git diff --git a/CMakeLists.txt b/CMakeLists.txt index cb545666..402501fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/externals/sanitizers-cmake b/externals/sanitizers-cmake new file mode 160000 index 00000000..6947cff3 --- /dev/null +++ b/externals/sanitizers-cmake @@ -0,0 +1 @@ +Subproject commit 6947cff3a9c9305eb9c16135dd81da3feb4bf87f