Merge 2ce57debf6
into 0bda7188b7
This commit is contained in:
commit
94f271c4d0
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "externals/sanitizers-cmake"]
|
||||||
|
path = externals/sanitizers-cmake
|
||||||
|
url = git://github.com/arsenm/sanitizers-cmake.git
|
|
@ -73,6 +73,7 @@ set(OPENJPEG_LIBRARY_PROPERTIES
|
||||||
# Path to additional CMake modules
|
# Path to additional CMake modules
|
||||||
set(CMAKE_MODULE_PATH
|
set(CMAKE_MODULE_PATH
|
||||||
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake
|
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake
|
||||||
|
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/externals/sanitizers-cmake/cmake
|
||||||
${CMAKE_MODULE_PATH})
|
${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
@ -245,6 +246,10 @@ check_symbol_exists(posix_memalign stdlib.h OPJ_HAVE_POSIX_MEMALIGN)
|
||||||
unset(CMAKE_REQUIRED_DEFINITIONS)
|
unset(CMAKE_REQUIRED_DEFINITIONS)
|
||||||
# memalign (obsolete)
|
# memalign (obsolete)
|
||||||
check_symbol_exists(memalign malloc.h OPJ_HAVE_MEMALIGN)
|
check_symbol_exists(memalign malloc.h OPJ_HAVE_MEMALIGN)
|
||||||
|
|
||||||
|
# Make sure there is Sanitizer support in CMake
|
||||||
|
find_package(Sanitizers)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Build Library
|
# Build Library
|
||||||
if(BUILD_JPIP_SERVER)
|
if(BUILD_JPIP_SERVER)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 6947cff3a9c9305eb9c16135dd81da3feb4bf87f
|
|
@ -44,6 +44,7 @@ endif()
|
||||||
# Loop over all executables:
|
# Loop over all executables:
|
||||||
foreach(exe opj_decompress opj_compress opj_dump)
|
foreach(exe opj_decompress opj_compress opj_dump)
|
||||||
add_executable(${exe} ${exe}.c ${common_SRCS})
|
add_executable(${exe} ${exe}.c ${common_SRCS})
|
||||||
|
add_sanitizers(${exe})
|
||||||
if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12")
|
if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12")
|
||||||
target_compile_options(${exe} PRIVATE ${OPENJP2_COMPILE_OPTIONS})
|
target_compile_options(${exe} PRIVATE ${OPENJP2_COMPILE_OPTIONS})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -28,6 +28,7 @@ endif()
|
||||||
# Loop over all executables:
|
# Loop over all executables:
|
||||||
foreach(exe opj_jp3d_compress opj_jp3d_decompress)
|
foreach(exe opj_jp3d_compress opj_jp3d_decompress)
|
||||||
add_executable(${exe} ${exe}.c ${common_SRCS})
|
add_executable(${exe} ${exe}.c ${common_SRCS})
|
||||||
|
add_sanitizers(${exe})
|
||||||
target_link_libraries(${exe} openjp3d)
|
target_link_libraries(${exe} openjp3d)
|
||||||
# On unix you need to link to the math library:
|
# On unix you need to link to the math library:
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
|
|
@ -10,6 +10,7 @@ include_directories(
|
||||||
|
|
||||||
# Tool to embed metadata into JP2 file
|
# Tool to embed metadata into JP2 file
|
||||||
add_executable(opj_jpip_addxml opj_jpip_addxml.c)
|
add_executable(opj_jpip_addxml opj_jpip_addxml.c)
|
||||||
|
add_sanitizers(opj_jpip_addxml)
|
||||||
# Install exe
|
# Install exe
|
||||||
install(TARGETS opj_jpip_addxml
|
install(TARGETS opj_jpip_addxml
|
||||||
EXPORT OpenJPEGTargets
|
EXPORT OpenJPEGTargets
|
||||||
|
@ -23,6 +24,7 @@ if(BUILD_JPIP_SERVER)
|
||||||
|
|
||||||
# Build executable
|
# Build executable
|
||||||
add_executable(opj_server ${OPJ_SERVER_SRCS})
|
add_executable(opj_server ${OPJ_SERVER_SRCS})
|
||||||
|
add_sanitizers(opj_server)
|
||||||
target_link_libraries(opj_server ${FCGI_LIBRARIES} openjpip_server)
|
target_link_libraries(opj_server ${FCGI_LIBRARIES} openjpip_server)
|
||||||
set_property(
|
set_property(
|
||||||
TARGET opj_server
|
TARGET opj_server
|
||||||
|
@ -49,6 +51,7 @@ set(EXES
|
||||||
)
|
)
|
||||||
foreach(exe ${EXES})
|
foreach(exe ${EXES})
|
||||||
add_executable(${exe} ${exe}.c)
|
add_executable(${exe} ${exe}.c)
|
||||||
|
add_sanitizers(${exe})
|
||||||
target_link_libraries(${exe} openjpip)
|
target_link_libraries(${exe} openjpip)
|
||||||
install(TARGETS ${exe}
|
install(TARGETS ${exe}
|
||||||
EXPORT OpenJPEGTargets
|
EXPORT OpenJPEGTargets
|
||||||
|
|
|
@ -37,6 +37,7 @@ foreach(exe decompress compress)
|
||||||
${jpwl_exe}.c
|
${jpwl_exe}.c
|
||||||
${common_SRCS}
|
${common_SRCS}
|
||||||
)
|
)
|
||||||
|
add_sanitizers(${jpwl_exe})
|
||||||
set_property(
|
set_property(
|
||||||
TARGET ${jpwl_exe}
|
TARGET ${jpwl_exe}
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
|
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
|
||||||
|
|
|
@ -32,6 +32,7 @@ foreach(exe
|
||||||
${MJ2_SRCS}
|
${MJ2_SRCS}
|
||||||
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
|
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
|
||||||
)
|
)
|
||||||
|
add_sanitizers(${exe})
|
||||||
set_property(
|
set_property(
|
||||||
TARGET ${exe}
|
TARGET ${exe}
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS USE_MJ2
|
APPEND PROPERTY COMPILE_DEFINITIONS USE_MJ2
|
||||||
|
|
|
@ -26,4 +26,5 @@ set(OPJV_SRCS
|
||||||
${OPENJPEG_SOURCE_DIR}/src/bin/jp2/index.c
|
${OPENJPEG_SOURCE_DIR}/src/bin/jp2/index.c
|
||||||
)
|
)
|
||||||
add_executable(opjviewer ${OPJV_SRCS})
|
add_executable(opjviewer ${OPJV_SRCS})
|
||||||
|
add_sanitizers(opjviewer)
|
||||||
target_link_libraries(opjviewer ${wxWidgets_LIBRARIES} openjpeg)
|
target_link_libraries(opjviewer ${wxWidgets_LIBRARIES} openjpeg)
|
||||||
|
|
|
@ -94,11 +94,14 @@ else()
|
||||||
if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
|
if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
|
||||||
# Builds both static and dynamic libs
|
# Builds both static and dynamic libs
|
||||||
add_library(${OPENJPEG_LIBRARY_NAME} SHARED ${OPENJPEG_SRCS})
|
add_library(${OPENJPEG_LIBRARY_NAME} SHARED ${OPENJPEG_SRCS})
|
||||||
|
add_sanitizers(${OPENJPEG_LIBRARY_NAME})
|
||||||
add_library(openjp2_static STATIC ${OPENJPEG_SRCS})
|
add_library(openjp2_static STATIC ${OPENJPEG_SRCS})
|
||||||
|
add_sanitizers(openjp2_static)
|
||||||
set_target_properties(openjp2_static PROPERTIES OUTPUT_NAME ${OPENJPEG_LIBRARY_NAME})
|
set_target_properties(openjp2_static PROPERTIES OUTPUT_NAME ${OPENJPEG_LIBRARY_NAME})
|
||||||
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME} openjp2_static)
|
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME} openjp2_static)
|
||||||
else()
|
else()
|
||||||
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
|
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
|
||||||
|
add_sanitizers(${OPENJPEG_LIBRARY_NAME})
|
||||||
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME})
|
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -135,6 +138,7 @@ if(BUILD_LUTS_GENERATOR)
|
||||||
# internal utility to generate t1_luts.h (part of the jp2 lib)
|
# internal utility to generate t1_luts.h (part of the jp2 lib)
|
||||||
# no need to install:
|
# no need to install:
|
||||||
add_executable(t1_generate_luts t1_generate_luts.c)
|
add_executable(t1_generate_luts t1_generate_luts.c)
|
||||||
|
add_sanitizers(t1_generate_luts)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(t1_generate_luts m)
|
target_link_libraries(t1_generate_luts m)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -23,6 +23,7 @@ endif()
|
||||||
|
|
||||||
# build jp3d lib:
|
# build jp3d lib:
|
||||||
add_library(${OPENJP3D_LIBRARY_NAME} ${OPENJP3D_SRCS})
|
add_library(${OPENJP3D_LIBRARY_NAME} ${OPENJP3D_SRCS})
|
||||||
|
add_sanitizers(${OPENJP3D_LIBRARY_NAME})
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(${OPENJP3D_LIBRARY_NAME} m)
|
target_link_libraries(${OPENJP3D_LIBRARY_NAME} m)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -60,6 +60,7 @@ if(WIN32)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
|
add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
|
||||||
|
add_sanitizers(openjpip)
|
||||||
set_target_properties(openjpip
|
set_target_properties(openjpip
|
||||||
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
||||||
if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12")
|
if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12")
|
||||||
|
@ -81,6 +82,7 @@ install(TARGETS openjpip
|
||||||
|
|
||||||
if(BUILD_JPIP_SERVER)
|
if(BUILD_JPIP_SERVER)
|
||||||
add_library(openjpip_server STATIC ${OPENJPIP_SRCS} ${SERVER_SRCS})
|
add_library(openjpip_server STATIC ${OPENJPIP_SRCS} ${SERVER_SRCS})
|
||||||
|
add_sanitizers(openjpip_server)
|
||||||
target_link_libraries(openjpip_server ${FCGI_LIBRARIES} ${CURL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(openjpip_server ${FCGI_LIBRARIES} ${CURL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
set_target_properties(openjpip_server
|
set_target_properties(openjpip_server
|
||||||
PROPERTIES COMPILE_FLAGS "-DSERVER")
|
PROPERTIES COMPILE_FLAGS "-DSERVER")
|
||||||
|
|
|
@ -46,6 +46,7 @@ if(WIN32)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
add_library(openjpwl ${JPWL_SRCS} ${OPENJPEG_SRCS})
|
add_library(openjpwl ${JPWL_SRCS} ${OPENJPEG_SRCS})
|
||||||
|
add_sanitizers(openjpwl)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(openjpwl m)
|
target_link_libraries(openjpwl m)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -40,6 +40,7 @@ endif()
|
||||||
|
|
||||||
# build mj2 lib:
|
# build mj2 lib:
|
||||||
add_library(${OPENMJ2_LIBRARY_NAME} ${OPENMJ2_SRCS})
|
add_library(${OPENMJ2_LIBRARY_NAME} ${OPENMJ2_SRCS})
|
||||||
|
add_sanitizers(${OPENMJ2_LIBRARY_NAME})
|
||||||
# FIXME: We are using an openjpeg 1.5 copy:
|
# FIXME: We are using an openjpeg 1.5 copy:
|
||||||
#target_link_libraries(${OPENMJ2_LIBRARY_NAME} openjp2)
|
#target_link_libraries(${OPENMJ2_LIBRARY_NAME} openjp2)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
|
Loading…
Reference in New Issue