early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc49726..25d6ff1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,11 @@ OPTION( TEST "Built unit tests" OFF )
SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON )
+if (MSVC)
+ # Allow deprecated functions
+ add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
+endif()
+
SET ( ly_base_dir ${PROJECT_SOURCE_DIR} )
SET ( ly_src_dir ${ly_base_dir}/source )
SET ( ly_inc_dir ${ly_base_dir}/include )

View File

@@ -0,0 +1,62 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50442cd..fdc82f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,24 +28,32 @@ LIST ( SORT ly_unittest_sources )
INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
# this creates the static library (.a)
+if (NOT BUILD_SHARED_LIBS)
ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )
SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h )
-
+else()
# 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" )
-
+endif()
# this creates the conversion tool
ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
-TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
-
+if (BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_shared} )
+else()
+ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
+endif()
INCLUDE ( FindJPEG )
if (JPEG_FOUND)
- include_directories( ${JPEG_INCLUDE_DIR} )
- target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} )
- target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
+ include_directories( ${JPEG_INCLUDE_DIR})
+ if( BUILD_SHARED_LIBS)
+ target_link_libraries(${ly_lib_shared} PUBLIC ${JPEG_LIBRARY})
+ else()
+ target_link_libraries(${ly_lib_static} PUBLIC ${JPEG_LIBRARY})
+ endif()
+ target_link_libraries(yuvconvert ${JPEG_LIBRARY})
add_definitions( -DHAVE_JPEG )
endif()
@@ -88,11 +96,13 @@ endif()
# install the conversion tool, .so, .a, and all the header files
-INSTALL ( TARGETS yuvconvert DESTINATION bin )
+INSTALL ( TARGETS yuvconvert DESTINATION tools )
INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv )
-INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
-INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
-
+if (NOT BUILD_SHARED_LIBS)
+ INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
+else()
+ INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
+endif()
INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES )
# create the .deb and .rpm packages using cpack

View File

@@ -0,0 +1,61 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed4948f..5b4e112 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,10 +2,14 @@
# Originally created for "roxlu build system" to compile libyuv on windows
# Run with -DTEST=ON to build unit tests
-PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
+CMAKE_POLICY( SET CMP0022 NEW )
+
+PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
OPTION( TEST "Built unit tests" OFF )
+SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON )
+
SET ( ly_base_dir ${PROJECT_SOURCE_DIR} )
SET ( ly_src_dir ${ly_base_dir}/source )
SET ( ly_inc_dir ${ly_base_dir}/include )
@@ -14,6 +18,7 @@ SET ( ly_lib_name yuv )
SET ( ly_lib_static ${ly_lib_name} )
SET ( ly_lib_shared ${ly_lib_name}_shared )
+FILE ( GLOB_RECURSE ly_include_files ${ly_inc_dir}/libyuv/*.h )
FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc )
LIST ( SORT ly_source_files )
@@ -24,6 +29,7 @@ INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
# this creates the static library (.a)
ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )
+SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h )
# this creates the shared library (.so)
ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} )
@@ -38,6 +44,7 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
INCLUDE ( FindJPEG )
if (JPEG_FOUND)
include_directories( ${JPEG_INCLUDE_DIR} )
+ target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} )
target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
add_definitions( -DHAVE_JPEG )
endif()
@@ -81,10 +88,12 @@ endif()
# 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 )
+INSTALL ( TARGETS yuvconvert DESTINATION bin )
+INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv )
+INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
+INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
+
+INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES )
# create the .deb and .rpm packages using cpack
INCLUDE ( CM_linux_packages.cmake )

View File

@@ -0,0 +1,5 @@
include(CMakeFindDependencyMacro)
find_dependency(JPEG)
set(libyuv_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include")
include("${CMAKE_CURRENT_LIST_DIR}/libyuv-targets.cmake")

32
externals/vcpkg/ports/libyuv/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,32 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL https://chromium.googlesource.com/libyuv/libyuv
REF 287158925b0e03ea4499a18b4e08478c5781541b #2021-4-15
PATCHES
fix_cmakelists.patch
fix-build-type.patch
deprecated-warning.patch
)
set(POSTFIX d)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG
-DCMAKE_DEBUG_POSTFIX=${POSTFIX}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/libyuv)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libyuv/convert.h "#ifdef HAVE_JPEG" "#if 1")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libyuv/convert_argb.h "#ifdef HAVE_JPEG" "#if 1")
configure_file(${CMAKE_CURRENT_LIST_DIR}/libyuv-config.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT} COPYONLY)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

18
externals/vcpkg/ports/libyuv/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,18 @@
{
"name": "libyuv",
"version-date": "2021-04-15",
"port-version": 1,
"description": "libyuv is an open source project that includes YUV scaling and conversion functionality",
"homepage": "https://chromium.googlesource.com/libyuv/libyuv",
"dependencies": [
"libjpeg-turbo",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}