mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-11-14 18:19:51 +01:00
Add options to build with additional system libraries - faad2, spirv-tools, and xxhash (#1987)
This commit is contained in:
1 parent
955ef51a27
commit
5c5169d9e1
4 files changed
+48
-18
No files matched your search
@@ -117,7 +117,10 @@ foreach(_opt IN LISTS _LIBRETRO_INCOMPATIBLE_OPTIONS)
|
||||
endforeach()
|
||||
|
||||
option(ENABLE_SDL2 "Enable using SDL2" ON)
|
||||
option(USE_SYSTEM_FAAD "Use the system faad2 lib (instead of the bundled one)" OFF)
|
||||
option(USE_SYSTEM_SDL2 "Use the system SDL2 lib (instead of the bundled one)" OFF)
|
||||
option(USE_SYSTEM_SPIRV_TOOLS "Use the system SPIRV-Tools lib (instead of the bundled one)" OFF)
|
||||
option(USE_SYSTEM_XXHASH "Use the system xxHash lib (instead of the bundled one)" OFF)
|
||||
|
||||
# Set bundled qt as dependent options.
|
||||
option(ENABLE_QT "Enable the Qt frontend" ON)
|
||||
@@ -579,6 +582,16 @@ if (USE_SYSTEM_SOUNDTOUCH)
|
||||
target_include_directories(SoundTouch INTERFACE "${SOUNDTOUCH_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
if (USE_SYSTEM_XXHASH)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(libxxhash_PKGCONFIG IMPORTED_TARGET libxxhash REQUIRED)
|
||||
endif()
|
||||
|
||||
if (USE_SYSTEM_FAAD)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(libfaad_PKGCONFIG IMPORTED_TARGET faad2 REQUIRED)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT citra_meta)
|
||||
|
||||
Vendored
+24
-16
@@ -169,7 +169,9 @@ endif()
|
||||
add_subdirectory(open_source_archives EXCLUDE_FROM_ALL)
|
||||
|
||||
# faad2
|
||||
add_subdirectory(faad2 EXCLUDE_FROM_ALL)
|
||||
if(NOT USE_SYSTEM_FAAD)
|
||||
add_subdirectory(faad2 EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# Dynamic library headers
|
||||
add_library(library-headers INTERFACE)
|
||||
@@ -439,9 +441,13 @@ if (ENABLE_VULKAN)
|
||||
endif()
|
||||
|
||||
# spirv-tools
|
||||
# TODO: Implement USE_SYSTEM_SPIRV_TOOLS -OS
|
||||
set(SPIRV_SKIP_EXECUTABLES ON)
|
||||
add_subdirectory(spirv-tools EXCLUDE_FROM_ALL)
|
||||
if(USE_SYSTEM_SPIRV_TOOLS)
|
||||
find_package(SPIRV-Tools REQUIRED)
|
||||
set(ALLOW_EXTERNAL_SPIRV_TOOLS ON)
|
||||
else()
|
||||
set(SPIRV_SKIP_EXECUTABLES ON)
|
||||
add_subdirectory(spirv-tools EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# glslang
|
||||
if(USE_SYSTEM_GLSLANG)
|
||||
@@ -512,16 +518,18 @@ if (ENABLE_VULKAN)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(XXHASH_BUILD_XXHSUM OFF)
|
||||
add_subdirectory(xxHash/cmake_unofficial EXCLUDE_FROM_ALL)
|
||||
target_compile_definitions(xxhash PRIVATE XXH_FORCE_MEMORY_ACCESS=2)
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
|
||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SSE2)
|
||||
message(STATUS "Enabling SSE2 for xxHash")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|armv8")
|
||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_NEON)
|
||||
message(STATUS "Enabling NEON for xxHash")
|
||||
else()
|
||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SCALAR)
|
||||
message(STATUS "Disabling SIMD for xxHash")
|
||||
if(NOT USE_SYSTEM_XXHASH)
|
||||
set(XXHASH_BUILD_XXHSUM OFF)
|
||||
add_subdirectory(xxHash/cmake_unofficial EXCLUDE_FROM_ALL)
|
||||
target_compile_definitions(xxhash PRIVATE XXH_FORCE_MEMORY_ACCESS=2)
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
|
||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SSE2)
|
||||
message(STATUS "Enabling SSE2 for xxHash")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|armv8")
|
||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_NEON)
|
||||
message(STATUS "Enabling NEON for xxHash")
|
||||
else()
|
||||
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SCALAR)
|
||||
message(STATUS "Disabling SIMD for xxHash")
|
||||
endif()
|
||||
endif()
|
||||
@@ -47,7 +47,12 @@ add_library(audio_core STATIC EXCLUDE_FROM_ALL
|
||||
create_target_directory_groups(audio_core)
|
||||
|
||||
target_link_libraries(audio_core PUBLIC citra_common citra_core)
|
||||
target_link_libraries(audio_core PRIVATE faad2 SoundTouch teakra)
|
||||
target_link_libraries(audio_core PRIVATE SoundTouch teakra)
|
||||
if(USE_SYSTEM_FAAD)
|
||||
target_link_libraries(audio_core PRIVATE faad)
|
||||
else()
|
||||
target_link_libraries(audio_core PRIVATE faad2)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SDL2)
|
||||
target_link_libraries(audio_core PRIVATE SDL2::SDL2)
|
||||
|
||||
@@ -176,4 +176,8 @@ if (BACKTRACE_LIBRARY AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND CMAKE_CXX_CO
|
||||
target_compile_definitions(citra_common PRIVATE CITRA_LINUX_GCC_BACKTRACE)
|
||||
endif()
|
||||
|
||||
target_link_libraries(citra_common PUBLIC xxHash::xxhash)
|
||||
if (USE_SYSTEM_XXHASH)
|
||||
target_link_libraries(citra_common PUBLIC xxhash)
|
||||
else()
|
||||
target_link_libraries(citra_common PUBLIC xxHash::xxhash)
|
||||
endif()
|
||||
Reference in new issue
Block a user