From 735eba9474785e9a9e05f665d8975022619026a7 Mon Sep 17 00:00:00 2001 From: Karol Babioch Date: Wed, 28 Feb 2018 17:37:58 +0100 Subject: [PATCH] Add basic sanitizer support to CMake --- .gitmodules | 3 +++ CMakeLists.txt | 5 +++++ externals/sanitizers-cmake | 1 + 3 files changed, 9 insertions(+) create mode 100644 .gitmodules create mode 160000 externals/sanitizers-cmake 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