cosmetic changes

pull/22643/head
Suleyman TURKMEN 2 years ago
parent 762481411d
commit 292f62c5cc
  1. 9
      3rdparty/libjpeg-turbo/CMakeLists.txt
  2. 32
      3rdparty/libjpeg-turbo/src/simd/CMakeLists.txt
  3. 8
      CMakeLists.txt

@ -56,8 +56,6 @@ if(MSVC_IDE AND CMAKE_GENERATOR_PLATFORM MATCHES "arm64")
set(CPU_TYPE arm64)
endif()
message(STATUS "${BITS}-bit build (${CPU_TYPE})")
OCV_OPTION(ENABLE_LIBJPEG_TURBO_SIMD "Include SIMD extensions for libjpeg-turbo, if available for this platform" (NOT CV_DISABLE_OPTIMIZATION)
VISIBLE_IF BUILD_JPEG)
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
@ -185,9 +183,10 @@ if(WITH_SIMD)
set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
endif()
else()
add_library(simd OBJECT src/jsimd_none.c)
add_library(jsimd OBJECT src/jsimd_none.c)
set_target_properties(jsimd PROPERTIES FOLDER "3rdparty")
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
set_target_properties(jsimd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
endif()
@ -195,7 +194,7 @@ ocv_list_add_prefix(JPEG_SOURCES src/)
set(JPEG_SOURCES ${JPEG_SOURCES} ${SIMD_OBJS})
add_library(${JPEG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${JPEG_SOURCES} $<TARGET_OBJECTS:simd> ${SIMD_OBJS})
add_library(${JPEG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${JPEG_SOURCES} $<TARGET_OBJECTS:jsimd> ${SIMD_OBJS})
set_target_properties(${JPEG_LIBRARY}
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}

@ -75,8 +75,6 @@ elseif(CPU_TYPE STREQUAL "i386")
endif()
endif()
message(STATUS "CMAKE_ASM_NASM_OBJECT_FORMAT = ${CMAKE_ASM_NASM_OBJECT_FORMAT}")
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
simd_fail("SIMD extensions disabled: could not determine NASM object format")
return()
@ -102,7 +100,6 @@ endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
set(EFFECTIVE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} ${CMAKE_ASM_NASM_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
message(STATUS "CMAKE_ASM_NASM_FLAGS = ${EFFECTIVE_ASM_NASM_FLAGS}")
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -I\"${CMAKE_CURRENT_SOURCE_DIR}/nasm/\" -I\"${CMAKE_CURRENT_SOURCE_DIR}/${CPU_TYPE}/\"")
@ -116,6 +113,7 @@ add_custom_target(jsimdcfg COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/nasm/jsimdcfg.inc.h |
${GREP} -E '^[\;%]|^\ %' | sed 's%_cpp_protection_%%' |
sed 's@% define@%define@g' >${CMAKE_CURRENT_SOURCE_DIR}/nasm/jsimdcfg.inc)
set_target_properties(jsimdcfg PROPERTIES FOLDER "3rdparty")
if(CPU_TYPE STREQUAL "x86_64")
set(SIMD_SOURCES x86_64/jsimdcpu.asm x86_64/jfdctflt-sse.asm
@ -200,14 +198,16 @@ endforeach()
if(MSVC_IDE OR XCODE)
set(SIMD_OBJS ${SIMD_OBJS} PARENT_SCOPE)
add_library(simd OBJECT ${CPU_TYPE}/jsimd.c)
add_custom_target(simd-objs DEPENDS ${SIMD_OBJS})
add_dependencies(simd simd-objs)
add_library(jsimd OBJECT ${CPU_TYPE}/jsimd.c)
add_custom_target(jsimd-objs DEPENDS ${SIMD_OBJS})
add_dependencies(jsimd jsimd-objs)
set_target_properties(jsimd PROPERTIES FOLDER "3rdparty")
set_target_properties(jsimd-objs PROPERTIES FOLDER "3rdparty")
else()
add_library(simd OBJECT ${SIMD_SOURCES} ${CPU_TYPE}/jsimd.c)
add_library(jsimd OBJECT ${SIMD_SOURCES} ${CPU_TYPE}/jsimd.c)
endif()
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
set_target_properties(jsimd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
@ -397,10 +397,10 @@ if(NOT NEON_INTRINSICS)
set(SIMD_SOURCES ${SIMD_SOURCES} arm/aarch${BITS}/jsimd_neon.S)
endif()
add_library(simd OBJECT ${SIMD_SOURCES} arm/aarch${BITS}/jsimd.c)
add_library(jsimd OBJECT ${SIMD_SOURCES} arm/aarch${BITS}/jsimd.c)
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
set_target_properties(jsimd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
@ -439,10 +439,10 @@ if(NOT HAVE_DSPR2)
return()
endif()
add_library(simd OBJECT mips/jsimd_dspr2.S mips/jsimd.c)
add_library(jsimd OBJECT mips/jsimd_dspr2.S mips/jsimd.c)
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
set_target_properties(jsimd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
###############################################################################
@ -487,10 +487,10 @@ foreach(file ${SIMD_SOURCES})
" -Wa,-mloongson-mmi,-mloongson-ext")
endforeach()
add_library(simd OBJECT ${SIMD_SOURCES} mips64/jsimd.c)
add_library(jsimd OBJECT ${SIMD_SOURCES} mips64/jsimd.c)
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
set_target_properties(jsimd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
###############################################################################
@ -527,10 +527,10 @@ set(SIMD_SOURCES powerpc/jccolor-altivec.c powerpc/jcgray-altivec.c
set_source_files_properties(${SIMD_SOURCES} PROPERTIES
COMPILE_FLAGS -maltivec)
add_library(simd OBJECT ${SIMD_SOURCES} powerpc/jsimd.c)
add_library(jsimd OBJECT ${SIMD_SOURCES} powerpc/jsimd.c)
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
set_target_properties(jsimd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()

@ -1347,14 +1347,14 @@ if(WITH_JPEG OR HAVE_JPEG)
elseif(BUILD_JPEG)
status(" JPEG:" "build-${JPEG_LIBRARY} (ver ${JPEG_LIB_VERSION})")
if(ENABLE_LIBJPEG_TURBO_SIMD)
status(" SIMD Support Request:" "YES")
status(" SIMD Support Request:" "YES")
if(HAVE_LIBJPEG_TURBO_SIMD)
status(" SIMD Support:" "YES")
status(" SIMD Support:" "YES")
else()
status(" SIMD Support:" "NO")
status(" SIMD Support:" "NO")
endif()
else()
status(" SIMD Support Request:" "NO")
status(" SIMD Support Request:" "NO")
endif()
else()
status(" JPEG:" "${JPEG_LIBRARY} (ver ${JPEG_LIB_VERSION})")

Loading…
Cancel
Save