mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 19:07:31 +09:00
Issue #2101 - Part 3: Update libyuv
Updated to version 1861, git revision 88b050f337cc0ca2a51800fe7bf4737222c87344 from https://chromium.googlesource.com/libyuv/libyuv/
This commit is contained in:
parent
42f3296899
commit
a4d1f57b9e
222 changed files with 111006 additions and 37106 deletions
|
|
@ -1,110 +1,55 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
# CMakeLists for libyuv
|
||||
# Originally created for "roxlu build system" to compile libyuv on windows
|
||||
# Run with -DTEST=ON to build unit tests
|
||||
option(TEST "Built unit tests" OFF)
|
||||
|
||||
set(ly_base_dir ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(ly_src_dir ${ly_base_dir}/source/)
|
||||
set(ly_inc_dir ${ly_base_dir}/include)
|
||||
set(ly_lib_name "yuv")
|
||||
PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
|
||||
OPTION( TEST "Built unit tests" OFF )
|
||||
|
||||
set(ly_source_files
|
||||
${ly_src_dir}/compare.cc
|
||||
${ly_src_dir}/compare_common.cc
|
||||
${ly_src_dir}/compare_neon.cc
|
||||
${ly_src_dir}/compare_neon64.cc
|
||||
${ly_src_dir}/compare_gcc.cc
|
||||
${ly_src_dir}/compare_win.cc
|
||||
${ly_src_dir}/convert.cc
|
||||
${ly_src_dir}/convert_argb.cc
|
||||
${ly_src_dir}/convert_from.cc
|
||||
${ly_src_dir}/convert_from_argb.cc
|
||||
${ly_src_dir}/convert_jpeg.cc
|
||||
${ly_src_dir}/convert_to_argb.cc
|
||||
${ly_src_dir}/convert_to_i420.cc
|
||||
${ly_src_dir}/cpu_id.cc
|
||||
${ly_src_dir}/mjpeg_decoder.cc
|
||||
${ly_src_dir}/mjpeg_validate.cc
|
||||
${ly_src_dir}/planar_functions.cc
|
||||
${ly_src_dir}/rotate.cc
|
||||
${ly_src_dir}/rotate_any.cc
|
||||
${ly_src_dir}/rotate_argb.cc
|
||||
${ly_src_dir}/rotate_common.cc
|
||||
${ly_src_dir}/rotate_mips.cc
|
||||
${ly_src_dir}/rotate_neon.cc
|
||||
${ly_src_dir}/rotate_neon64.cc
|
||||
${ly_src_dir}/rotate_gcc.cc
|
||||
${ly_src_dir}/rotate_win.cc
|
||||
${ly_src_dir}/row_any.cc
|
||||
${ly_src_dir}/row_common.cc
|
||||
${ly_src_dir}/row_mips.cc
|
||||
${ly_src_dir}/row_neon.cc
|
||||
${ly_src_dir}/row_neon64.cc
|
||||
${ly_src_dir}/row_gcc.cc
|
||||
${ly_src_dir}/row_win.cc
|
||||
${ly_src_dir}/scale.cc
|
||||
${ly_src_dir}/scale_any.cc
|
||||
${ly_src_dir}/scale_argb.cc
|
||||
${ly_src_dir}/scale_common.cc
|
||||
${ly_src_dir}/scale_mips.cc
|
||||
${ly_src_dir}/scale_neon.cc
|
||||
${ly_src_dir}/scale_neon64.cc
|
||||
${ly_src_dir}/scale_gcc.cc
|
||||
${ly_src_dir}/scale_win.cc
|
||||
${ly_src_dir}/video_common.cc
|
||||
)
|
||||
SET ( ly_base_dir ${PROJECT_SOURCE_DIR} )
|
||||
SET ( ly_src_dir ${ly_base_dir}/source )
|
||||
SET ( ly_inc_dir ${ly_base_dir}/include )
|
||||
SET ( ly_tst_dir ${ly_base_dir}/unit_test )
|
||||
SET ( ly_lib_name yuv )
|
||||
SET ( ly_lib_static ${ly_lib_name} )
|
||||
SET ( ly_lib_shared ${ly_lib_name}_shared )
|
||||
|
||||
set(ly_unittest_sources
|
||||
${ly_base_dir}/unit_test/basictypes_test.cc
|
||||
${ly_base_dir}/unit_test/color_test.cc
|
||||
${ly_base_dir}/unit_test/compare_test.cc
|
||||
${ly_base_dir}/unit_test/convert_test.cc
|
||||
${ly_base_dir}/unit_test/cpu_test.cc
|
||||
${ly_base_dir}/unit_test/math_test.cc
|
||||
${ly_base_dir}/unit_test/planar_test.cc
|
||||
${ly_base_dir}/unit_test/rotate_argb_test.cc
|
||||
${ly_base_dir}/unit_test/rotate_test.cc
|
||||
${ly_base_dir}/unit_test/scale_argb_test.cc
|
||||
${ly_base_dir}/unit_test/scale_test.cc
|
||||
${ly_base_dir}/unit_test/unit_test.cc
|
||||
${ly_base_dir}/unit_test/video_common_test.cc
|
||||
)
|
||||
FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc )
|
||||
LIST ( SORT ly_source_files )
|
||||
|
||||
set(ly_header_files
|
||||
${ly_inc_dir}/libyuv/basic_types.h
|
||||
${ly_inc_dir}/libyuv/compare.h
|
||||
${ly_inc_dir}/libyuv/convert.h
|
||||
${ly_inc_dir}/libyuv/convert_argb.h
|
||||
${ly_inc_dir}/libyuv/convert_from.h
|
||||
${ly_inc_dir}/libyuv/convert_from_argb.h
|
||||
${ly_inc_dir}/libyuv/cpu_id.h
|
||||
${ly_inc_dir}/libyuv/planar_functions.h
|
||||
${ly_inc_dir}/libyuv/rotate.h
|
||||
${ly_inc_dir}/libyuv/rotate_argb.h
|
||||
${ly_inc_dir}/libyuv/rotate_row.h
|
||||
${ly_inc_dir}/libyuv/row.h
|
||||
${ly_inc_dir}/libyuv/scale.h
|
||||
${ly_inc_dir}/libyuv/scale_argb.h
|
||||
${ly_inc_dir}/libyuv/scale_row.h
|
||||
${ly_inc_dir}/libyuv/version.h
|
||||
${ly_inc_dir}/libyuv/video_common.h
|
||||
${ly_inc_dir}/libyuv/mjpeg_decoder.h
|
||||
)
|
||||
FILE ( GLOB_RECURSE ly_unittest_sources ${ly_tst_dir}/*.cc )
|
||||
LIST ( SORT ly_unittest_sources )
|
||||
|
||||
include_directories(${ly_inc_dir})
|
||||
INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
|
||||
|
||||
add_library(${ly_lib_name} STATIC ${ly_source_files})
|
||||
if(MSVC)
|
||||
ADD_DEFINITIONS ( -D_CRT_SECURE_NO_WARNINGS )
|
||||
endif()
|
||||
|
||||
add_executable(convert ${ly_base_dir}/util/convert.cc)
|
||||
target_link_libraries(convert ${ly_lib_name})
|
||||
# this creates the static library (.a)
|
||||
ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )
|
||||
|
||||
include(FindJPEG)
|
||||
# this creates the shared library (.so)
|
||||
ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} )
|
||||
SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
|
||||
SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
|
||||
if(WIN32)
|
||||
SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" )
|
||||
endif()
|
||||
|
||||
# this creates the conversion tool
|
||||
ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
|
||||
TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
|
||||
|
||||
# this creates the yuvconstants tool
|
||||
ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c )
|
||||
TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} )
|
||||
|
||||
find_package ( JPEG )
|
||||
if (JPEG_FOUND)
|
||||
include_directories(${JPEG_INCLUDE_DIR})
|
||||
target_link_libraries(convert ${JPEG_LIBRARY})
|
||||
add_definitions(-DHAVE_JPEG)
|
||||
include_directories( ${JPEG_INCLUDE_DIR} )
|
||||
target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} )
|
||||
add_definitions( -DHAVE_JPEG )
|
||||
endif()
|
||||
|
||||
if(TEST)
|
||||
|
|
@ -124,19 +69,33 @@ if(TEST)
|
|||
endif()
|
||||
|
||||
add_executable(libyuv_unittest ${ly_unittest_sources})
|
||||
target_link_libraries(libyuv_unittest ${ly_lib_name} ${GTEST_LIBRARY} pthread)
|
||||
target_link_libraries(libyuv_unittest ${ly_lib_name} ${GTEST_LIBRARY})
|
||||
find_library(PTHREAD_LIBRARY pthread)
|
||||
if(NOT PTHREAD_LIBRARY STREQUAL "PTHREAD_LIBRARY-NOTFOUND")
|
||||
target_link_libraries(libyuv_unittest pthread)
|
||||
endif()
|
||||
if (JPEG_FOUND)
|
||||
target_link_libraries(libyuv_unittest ${JPEG_LIBRARY})
|
||||
endif()
|
||||
|
||||
|
||||
if(NACL AND NACL_LIBC STREQUAL "newlib")
|
||||
target_link_libraries(libyuv_unittest glibc-compat)
|
||||
endif()
|
||||
|
||||
target_link_libraries(libyuv_unittest gflags)
|
||||
|
||||
find_library(GFLAGS_LIBRARY gflags)
|
||||
if(NOT GFLAGS_LIBRARY STREQUAL "GFLAGS_LIBRARY-NOTFOUND")
|
||||
target_link_libraries(libyuv_unittest gflags)
|
||||
add_definitions(-DLIBYUV_USE_GFLAGS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(TARGETS ${ly_lib_name} DESTINATION lib)
|
||||
install(FILES ${ly_header_files} DESTINATION include/libyuv)
|
||||
install(FILES ${ly_inc_dir}/libyuv.h DESTINATION include/)
|
||||
|
||||
# install the conversion tool, .so, .a, and all the header files
|
||||
INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )
|
||||
INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib )
|
||||
INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
|
||||
INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
|
||||
|
||||
# create the .deb and .rpm packages using cpack
|
||||
INCLUDE ( CM_linux_packages.cmake )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue