diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 78 |
1 files changed, 30 insertions, 48 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index facf4ea5f..cd59e7485 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,8 +31,6 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSV option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) -option(YUZU_USE_BUNDLED_LIBUSB "Compile bundled libusb" OFF) - option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}") option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF) @@ -43,8 +41,6 @@ option(ENABLE_CUBEB "Enables the cubeb audio backend" ON) option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF) -option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON) - option(YUZU_TESTS "Compile tests" ON) option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) @@ -201,24 +197,40 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) # System imported libraries # ======================================================================= -find_package(fmt 8.0.1 REQUIRED CONFIG) -find_package(nlohmann_json 3.8 REQUIRED CONFIG) +find_package(enet 1.3) +find_package(fmt 9 REQUIRED) +find_package(inih) +find_package(libusb 1.0.24) +find_package(lz4 REQUIRED) +find_package(nlohmann_json 3.8 REQUIRED) +find_package(Opus 1.3) +find_package(Vulkan 1.3.213) find_package(ZLIB 1.2 REQUIRED) +find_package(zstd 1.5 REQUIRED) -# Search for config-only package first (for vcpkg), then try non-config -find_package(zstd 1.5 CONFIG) -if (NOT zstd_FOUND) - find_package(zstd 1.5 REQUIRED) +if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) + find_package(xbyak 6) endif() -# lz4 1.8 is required, but vcpkg's lz4-config.cmake does not have version info -find_package(lz4 CONFIG) -if (NOT lz4_FOUND) - find_package(lz4 1.8 REQUIRED) +if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) + find_package(dynarmic 6.4.0) +endif() + +if (ENABLE_CUBEB) + find_package(cubeb) +endif() + +if (USE_DISCORD_PRESENCE) + find_package(DiscordRPC) +endif() + +if (ENABLE_WEB_SERVICE) + find_package(cpp-jwt 1.4) + find_package(httplib 0.11) endif() if (YUZU_TESTS) - find_package(Catch2 2.13.7 REQUIRED CONFIG) + find_package(Catch2 2.13.7 REQUIRED) endif() find_package(Boost 1.73.0 COMPONENTS context) @@ -420,23 +432,13 @@ if (ENABLE_SDL2) set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library") set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll") - add_library(SDL2 INTERFACE) - target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") - target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") + add_library(SDL2::SDL2 INTERFACE IMPORTED) + target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}") + target_include_directories(SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") elseif (YUZU_USE_EXTERNAL_SDL2) message(STATUS "Using SDL2 from externals.") else() find_package(SDL2 2.0.18 REQUIRED) - - # Some installations don't set SDL2_LIBRARIES - if("${SDL2_LIBRARIES}" STREQUAL "") - message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") - set(SDL2_LIBRARIES "SDL2::SDL2") - endif() - - include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) - add_library(SDL2 INTERFACE) - target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") endif() endif() @@ -448,26 +450,6 @@ if (TARGET Boost::boost) add_library(boost ALIAS Boost::boost) endif() -# Ensure libusb is properly configured (based on dolphin libusb include) -if(NOT YUZU_USE_BUNDLED_LIBUSB) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND AND NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD") - pkg_check_modules(LIBUSB QUIET libusb-1.0>=1.0.24) - else() - find_package(LibUSB) - endif() - - if (LIBUSB_FOUND) - add_library(usb INTERFACE) - target_include_directories(usb INTERFACE "${LIBUSB_INCLUDEDIR}" "${LIBUSB_INCLUDE_DIRS}") - target_link_directories(usb INTERFACE "${LIBUSB_LIBRARY_DIRS}") - target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARIES}") - else() - message(WARNING "libusb not found, falling back to externals") - set(YUZU_USE_BUNDLED_LIBUSB ON) - endif() -endif() - # List of all FFmpeg components required set(FFmpeg_COMPONENTS avcodec |