Commit d5a3ad5b authored by Alexander Alekhin's avatar Alexander Alekhin

3rdparty: update libjpeg-turbo/CMakeLists.txt

parent 30cf5e01
...@@ -18,16 +18,38 @@ message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}") ...@@ -18,16 +18,38 @@ message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE) option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE) option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
if(NOT DEFINED SIZEOF_SIZE_T) include(CheckCSourceCompiles)
if(IOS) # Workaround iOS issues include(CheckIncludeFiles)
set(SIZEOF_SIZE_T "${CMAKE_SIZEOF_VOID_P}") include(CheckTypeSize)
message(STATUS "SIZEOF_SIZE_T = ${SIZEOF_SIZE_T}")
else() check_type_size("size_t" SIZEOF_SIZE_T)
include(CheckTypeSize) check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
endif() if(SIZEOF_SIZE_T EQUAL SIZEOF_UNSIGNED_LONG)
check_c_source_compiles("int main(int argc, char **argv) { unsigned long a = argc; return __builtin_ctzl(a); }"
HAVE_BUILTIN_CTZL)
endif()
if(MSVC)
check_include_files("intrin.h" HAVE_INTRIN_H)
endif() endif()
if(UNIX)
# Check for headers
check_include_files(locale.h HAVE_LOCALE_H)
check_include_files(stddef.h HAVE_STDDEF_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(sys/types.h NEED_SYS_TYPES_H)
# Other predefines
# undef NEED_BSD_STRINGS
ocv_update(HAVE_UNSIGNED_CHAR 1)
ocv_update(HAVE_UNSIGNED_SHORT 1)
# undef INCOMPLETE_TYPES_BROKEN
ocv_update(RIGHT_SHIFT_IS_UNSIGNED 0)
ocv_update(__CHAR_UNSIGNED__ 0)
endif()
set(BITS_IN_JSAMPLE 8) set(BITS_IN_JSAMPLE 8)
if(WITH_ARITH_ENC) if(WITH_ARITH_ENC)
...@@ -47,7 +69,11 @@ if(MSVC) ...@@ -47,7 +69,11 @@ if(MSVC)
add_definitions(-W3 -wd4996 -wd4018) add_definitions(-W3 -wd4996 -wd4018)
endif() endif()
configure_file(jconfig.h.in jconfig.h) if(WIN32)
configure_file(jconfig.h.win.in jconfig.h)
else()
configure_file(jconfig.h.in jconfig.h)
endif()
configure_file(jconfigint.h.in jconfigint.h) configure_file(jconfigint.h.in jconfigint.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
......
...@@ -5,7 +5,15 @@ ...@@ -5,7 +5,15 @@
#undef inline #undef inline
/* How to obtain function inlining. */ /* How to obtain function inlining. */
#define INLINE @INLINE@ #ifndef INLINE
#if defined(__GNUC__)
#define INLINE inline __attribute__((always_inline))
#elif defined(_MSC_VER)
#define INLINE __forceinline
#else
#define INLINE
#endif
#endif
/* Define to the full name of this package. */ /* Define to the full name of this package. */
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@" #define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
...@@ -14,7 +22,7 @@ ...@@ -14,7 +22,7 @@
#define VERSION "@VERSION@" #define VERSION "@VERSION@"
/* The size of `size_t', as computed by sizeof. */ /* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T @SIZE_T@ #define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */ /* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
#cmakedefine HAVE_BUILTIN_CTZL #cmakedefine HAVE_BUILTIN_CTZL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment