mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-06-04 23:05:00 -06:00
Add more options, fix compatibility with ffmpeg 8
This commit is contained in:
parent
3066887ff4
commit
1c528d8d7f
@ -507,6 +507,9 @@ add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY
|
|||||||
-DBOOST_REGEX_NO_LIB
|
-DBOOST_REGEX_NO_LIB
|
||||||
)
|
)
|
||||||
if (USE_SYSTEM_BOOST)
|
if (USE_SYSTEM_BOOST)
|
||||||
|
if(POLICY CMP0167)
|
||||||
|
cmake_policy(SET CMP0167 NEW) #boost config policy
|
||||||
|
endif()
|
||||||
find_package(Boost 1.70.0 COMPONENTS container locale serialization iostreams REQUIRED)
|
find_package(Boost 1.70.0 COMPONENTS container locale serialization iostreams REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
81
externals/CMakeLists.txt
vendored
81
externals/CMakeLists.txt
vendored
@ -175,19 +175,38 @@ endif()
|
|||||||
# Open Source Archives
|
# Open Source Archives
|
||||||
add_subdirectory(open_source_archives)
|
add_subdirectory(open_source_archives)
|
||||||
|
|
||||||
# faad2
|
if (USE_SYSTEM_FAAD2)
|
||||||
add_subdirectory(faad2 EXCLUDE_FROM_ALL)
|
pkg_check_modules(FAAD2 faad2)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT FAAD2_FOUND)
|
||||||
|
message(STATUS "Using bundled FAAD2")
|
||||||
|
add_subdirectory(faad2 EXCLUDE_FROM_ALL)
|
||||||
|
else()
|
||||||
|
message(STATUS "Using system FAAD2")
|
||||||
|
add_library(faad2 INTERFACE)
|
||||||
|
target_include_directories(faad2 INTERFACE ${FAAD2_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(faad2 INTERFACE ${FAAD2_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Dynamic library headers
|
# Dynamic library headers
|
||||||
add_library(library-headers INTERFACE)
|
add_library(library-headers INTERFACE)
|
||||||
|
|
||||||
if (USE_SYSTEM_FFMPEG_HEADERS)
|
if (USE_SYSTEM_FFMPEG_HEADERS)
|
||||||
find_path(SYSTEM_FFMPEG_INCLUDES NAMES libavutil/avutil.h)
|
pkg_check_modules(FFMPEG_LIBAVUTIL libavutil)
|
||||||
if (SYSTEM_FFMPEG_INCLUDES STREQUAL "SYSTEM_FFMPEG_INCLUDES-NOTFOUND")
|
if (NOT FFMPEG_LIBAVUTIL_FOUND)
|
||||||
message(WARNING "System FFmpeg headers not found. Falling back on bundled headers.")
|
find_path(SYSTEM_FFMPEG_INCLUDES NAMES libavutil/avutil.h)
|
||||||
|
if (SYSTEM_FFMPEG_INCLUDES STREQUAL "SYSTEM_FFMPEG_INCLUDES-NOTFOUND")
|
||||||
|
message(WARNING "System FFmpeg headers not found. Falling back on bundled headers.")
|
||||||
|
else()
|
||||||
|
message(STATUS "Using system FFmpeg headers.")
|
||||||
|
target_include_directories(library-headers SYSTEM INTERFACE ${SYSTEM_FFMPEG_INCLUDES})
|
||||||
|
set(FOUND_FFMPEG_HEADERS ON)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using system FFmpeg headers.")
|
target_include_directories(library-headers INTERFACE ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS})
|
||||||
target_include_directories(library-headers SYSTEM INTERFACE ${SYSTEM_FFMPEG_INCLUDES})
|
target_link_libraries(library-headers INTERFACE ${FFMPEG_LIBAVUTIL_LIBRARIES})
|
||||||
set(FOUND_FFMPEG_HEADERS ON)
|
set(FOUND_FFMPEG_HEADERS ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -207,8 +226,12 @@ if(NOT USE_SYSTEM_SOUNDTOUCH)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Teakra
|
# Teakra
|
||||||
set(BUILD_TESTING OFF CACHE BOOL "")
|
if (USE_SYSTEM_TEAKRA)
|
||||||
add_subdirectory(teakra EXCLUDE_FROM_ALL)
|
find_package(teakra CONFIG REQUIRED)
|
||||||
|
else()
|
||||||
|
set(BUILD_TESTING OFF CACHE BOOL "")
|
||||||
|
add_subdirectory(teakra EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
# SDL2
|
# SDL2
|
||||||
if (ENABLE_SDL2 AND NOT USE_SYSTEM_SDL2)
|
if (ENABLE_SDL2 AND NOT USE_SYSTEM_SDL2)
|
||||||
@ -446,10 +469,17 @@ if (ENABLE_VULKAN)
|
|||||||
add_subdirectory(spirv-headers EXCLUDE_FROM_ALL)
|
add_subdirectory(spirv-headers EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# spirv-tools
|
if (USE_SYSTEM_SPIRV_TOOLS)
|
||||||
# TODO: Implement USE_SYSTEM_SPIRV_TOOLS -OS
|
find_package(SPIRV-Tools QUIET)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (SPIRV-Tools_FOUND)
|
||||||
|
message(STATUS "Using system SPIRV-Tools")
|
||||||
|
else()
|
||||||
|
message(STATUS "Using bundled SPIRV-Tools")
|
||||||
set(SPIRV_SKIP_EXECUTABLES ON)
|
set(SPIRV_SKIP_EXECUTABLES ON)
|
||||||
add_subdirectory(spirv-tools EXCLUDE_FROM_ALL)
|
add_subdirectory(spirv-tools EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
# glslang
|
# glslang
|
||||||
if(USE_SYSTEM_GLSLANG)
|
if(USE_SYSTEM_GLSLANG)
|
||||||
@ -507,16 +537,19 @@ if (ENABLE_VULKAN)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(XXHASH_BUILD_XXHSUM OFF)
|
|
||||||
add_subdirectory(xxHash/cmake_unofficial EXCLUDE_FROM_ALL)
|
if(NOT USE_SYSTEM_XXHASH)
|
||||||
target_compile_definitions(xxhash PRIVATE XXH_FORCE_MEMORY_ACCESS=2)
|
set(XXHASH_BUILD_XXHSUM OFF)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
|
add_subdirectory(xxHash/cmake_unofficial EXCLUDE_FROM_ALL)
|
||||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SSE2)
|
target_compile_definitions(xxhash PRIVATE XXH_FORCE_MEMORY_ACCESS=2)
|
||||||
message(STATUS "Enabling SSE2 for xxHash")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
|
||||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|armv8")
|
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SSE2)
|
||||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_NEON)
|
message(STATUS "Enabling SSE2 for xxHash")
|
||||||
message(STATUS "Enabling NEON for xxHash")
|
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|armv8")
|
||||||
else()
|
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_NEON)
|
||||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SCALAR)
|
message(STATUS "Enabling NEON for xxHash")
|
||||||
message(STATUS "Disabling SIMD for xxHash")
|
else()
|
||||||
endif()
|
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SCALAR)
|
||||||
|
message(STATUS "Disabling SIMD for xxHash")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|||||||
@ -28,6 +28,11 @@ option(USE_SYSTEM_VMA "Use the system VulkanMemoryAllocator (instead of the bund
|
|||||||
option(USE_SYSTEM_VULKAN_HEADERS "Use the system Vulkan headers (instead of the bundled ones)" OFF)
|
option(USE_SYSTEM_VULKAN_HEADERS "Use the system Vulkan headers (instead of the bundled ones)" OFF)
|
||||||
option(USE_SYSTEM_SPIRV_HEADERS "Use the system SPIRV headers (instead of the bundled ones)" OFF)
|
option(USE_SYSTEM_SPIRV_HEADERS "Use the system SPIRV headers (instead of the bundled ones)" OFF)
|
||||||
option(USE_SYSTEM_CATCH2 "Use the system Catch2 (instead of the bundled one)" OFF)
|
option(USE_SYSTEM_CATCH2 "Use the system Catch2 (instead of the bundled one)" OFF)
|
||||||
|
option(USE_SYSTEM_XXHASH "Use the system xxHash (instead of the bundled one)" OFF)
|
||||||
|
option(USE_SYSTEM_SPIRV_TOOLS "Use system-installed SPIRV-Tools" OFF)
|
||||||
|
option(USE_SYSTEM_FAAD2 "Use system-installed SPIRV-Tools" OFF)
|
||||||
|
option(USE_SYSTEM_TEAKRA "Use system-installed SPIRV-Tools" OFF)
|
||||||
|
|
||||||
|
|
||||||
# Qt and MoltenVK are handled separately
|
# Qt and MoltenVK are handled separately
|
||||||
CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_SDL2 "Disable system SDL2" OFF "USE_SYSTEM_LIBS" OFF)
|
CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_SDL2 "Disable system SDL2" OFF "USE_SYSTEM_LIBS" OFF)
|
||||||
|
|||||||
@ -10,6 +10,10 @@
|
|||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
#include "ui_option_set_dialog.h"
|
#include "ui_option_set_dialog.h"
|
||||||
|
|
||||||
|
#ifndef AV_OPT_TYPE_CHANNEL_LAYOUT
|
||||||
|
#define AV_OPT_TYPE_CHANNEL_LAYOUT AV_OPT_TYPE_CHLAYOUT
|
||||||
|
#endif
|
||||||
|
|
||||||
static const std::unordered_map<AVOptionType, const char*> TypeNameMap{{
|
static const std::unordered_map<AVOptionType, const char*> TypeNameMap{{
|
||||||
{AV_OPT_TYPE_BOOL, QT_TR_NOOP("boolean")},
|
{AV_OPT_TYPE_BOOL, QT_TR_NOOP("boolean")},
|
||||||
{AV_OPT_TYPE_FLAGS, QT_TR_NOOP("flags")},
|
{AV_OPT_TYPE_FLAGS, QT_TR_NOOP("flags")},
|
||||||
|
|||||||
@ -176,4 +176,11 @@ if (SSE42_COMPILE_OPTION)
|
|||||||
target_compile_options(citra_common PRIVATE ${SSE42_COMPILE_OPTION})
|
target_compile_options(citra_common PRIVATE ${SSE42_COMPILE_OPTION})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(citra_common PUBLIC xxHash::xxhash)
|
if(USE_SYSTEM_XXHASH)
|
||||||
|
pkg_check_modules(XXHASH REQUIRED libxxhash)
|
||||||
|
target_include_directories(citra_common PRIVATE ${XXHASH_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(citra_common PRIVATE ${XXHASH_LIBRARIES})
|
||||||
|
target_compile_options(citra_common PRIVATE ${XXHASH_CFLAGS_OTHER})
|
||||||
|
else()
|
||||||
|
target_link_libraries(citra_common PUBLIC xxHash::xxhash)
|
||||||
|
endif()
|
||||||
|
|||||||
@ -16,6 +16,11 @@
|
|||||||
#include "video_core/gpu.h"
|
#include "video_core/gpu.h"
|
||||||
#include "video_core/renderer_base.h"
|
#include "video_core/renderer_base.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef AV_OPT_TYPE_CHANNEL_LAYOUT
|
||||||
|
#define AV_OPT_TYPE_CHANNEL_LAYOUT AV_OPT_TYPE_CHLAYOUT
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace DynamicLibrary;
|
using namespace DynamicLibrary;
|
||||||
|
|
||||||
namespace VideoDumper {
|
namespace VideoDumper {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user