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 | |||
| 31 | 31 | ||
| 32 | option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) | 32 | option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) |
| 33 | 33 | ||
| 34 | option(YUZU_USE_BUNDLED_LIBUSB "Compile bundled libusb" OFF) | ||
| 35 | |||
| 36 | option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}") | 34 | option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}") |
| 37 | 35 | ||
| 38 | option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF) | 36 | option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF) |
| @@ -43,8 +41,6 @@ option(ENABLE_CUBEB "Enables the cubeb audio backend" ON) | |||
| 43 | 41 | ||
| 44 | option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF) | 42 | option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF) |
| 45 | 43 | ||
| 46 | option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON) | ||
| 47 | |||
| 48 | option(YUZU_TESTS "Compile tests" ON) | 44 | option(YUZU_TESTS "Compile tests" ON) |
| 49 | 45 | ||
| 50 | option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) | 46 | option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) |
| @@ -201,24 +197,40 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | |||
| 201 | # System imported libraries | 197 | # System imported libraries |
| 202 | # ======================================================================= | 198 | # ======================================================================= |
| 203 | 199 | ||
| 204 | find_package(fmt 8.0.1 REQUIRED CONFIG) | 200 | find_package(enet 1.3) |
| 205 | find_package(nlohmann_json 3.8 REQUIRED CONFIG) | 201 | find_package(fmt 9 REQUIRED) |
| 202 | find_package(inih) | ||
| 203 | find_package(libusb 1.0.24) | ||
| 204 | find_package(lz4 REQUIRED) | ||
| 205 | find_package(nlohmann_json 3.8 REQUIRED) | ||
| 206 | find_package(Opus 1.3) | ||
| 207 | find_package(Vulkan 1.3.213) | ||
| 206 | find_package(ZLIB 1.2 REQUIRED) | 208 | find_package(ZLIB 1.2 REQUIRED) |
| 209 | find_package(zstd 1.5 REQUIRED) | ||
| 207 | 210 | ||
| 208 | # Search for config-only package first (for vcpkg), then try non-config | 211 | if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) |
| 209 | find_package(zstd 1.5 CONFIG) | 212 | find_package(xbyak 6) |
| 210 | if (NOT zstd_FOUND) | ||
| 211 | find_package(zstd 1.5 REQUIRED) | ||
| 212 | endif() | 213 | endif() |
| 213 | 214 | ||
| 214 | # lz4 1.8 is required, but vcpkg's lz4-config.cmake does not have version info | 215 | if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) |
| 215 | find_package(lz4 CONFIG) | 216 | find_package(dynarmic 6.4.0) |
| 216 | if (NOT lz4_FOUND) | 217 | endif() |
| 217 | find_package(lz4 1.8 REQUIRED) | 218 | |
| 219 | if (ENABLE_CUBEB) | ||
| 220 | find_package(cubeb) | ||
| 221 | endif() | ||
| 222 | |||
| 223 | if (USE_DISCORD_PRESENCE) | ||
| 224 | find_package(DiscordRPC) | ||
| 225 | endif() | ||
| 226 | |||
| 227 | if (ENABLE_WEB_SERVICE) | ||
| 228 | find_package(cpp-jwt 1.4) | ||
| 229 | find_package(httplib 0.11) | ||
| 218 | endif() | 230 | endif() |
| 219 | 231 | ||
| 220 | if (YUZU_TESTS) | 232 | if (YUZU_TESTS) |
| 221 | find_package(Catch2 2.13.7 REQUIRED CONFIG) | 233 | find_package(Catch2 2.13.7 REQUIRED) |
| 222 | endif() | 234 | endif() |
| 223 | 235 | ||
| 224 | find_package(Boost 1.73.0 COMPONENTS context) | 236 | find_package(Boost 1.73.0 COMPONENTS context) |
| @@ -420,23 +432,13 @@ if (ENABLE_SDL2) | |||
| 420 | set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library") | 432 | set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library") |
| 421 | set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll") | 433 | set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll") |
| 422 | 434 | ||
| 423 | add_library(SDL2 INTERFACE) | 435 | add_library(SDL2::SDL2 INTERFACE IMPORTED) |
| 424 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") | 436 | target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}") |
| 425 | target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") | 437 | target_include_directories(SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") |
| 426 | elseif (YUZU_USE_EXTERNAL_SDL2) | 438 | elseif (YUZU_USE_EXTERNAL_SDL2) |
| 427 | message(STATUS "Using SDL2 from externals.") | 439 | message(STATUS "Using SDL2 from externals.") |
| 428 | else() | 440 | else() |
| 429 | find_package(SDL2 2.0.18 REQUIRED) | 441 | find_package(SDL2 2.0.18 REQUIRED) |
| 430 | |||
| 431 | # Some installations don't set SDL2_LIBRARIES | ||
| 432 | if("${SDL2_LIBRARIES}" STREQUAL "") | ||
| 433 | message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") | ||
| 434 | set(SDL2_LIBRARIES "SDL2::SDL2") | ||
| 435 | endif() | ||
| 436 | |||
| 437 | include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) | ||
| 438 | add_library(SDL2 INTERFACE) | ||
| 439 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") | ||
| 440 | endif() | 442 | endif() |
| 441 | endif() | 443 | endif() |
| 442 | 444 | ||
| @@ -448,26 +450,6 @@ if (TARGET Boost::boost) | |||
| 448 | add_library(boost ALIAS Boost::boost) | 450 | add_library(boost ALIAS Boost::boost) |
| 449 | endif() | 451 | endif() |
| 450 | 452 | ||
| 451 | # Ensure libusb is properly configured (based on dolphin libusb include) | ||
| 452 | if(NOT YUZU_USE_BUNDLED_LIBUSB) | ||
| 453 | find_package(PkgConfig) | ||
| 454 | if (PKG_CONFIG_FOUND AND NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD") | ||
| 455 | pkg_check_modules(LIBUSB QUIET libusb-1.0>=1.0.24) | ||
| 456 | else() | ||
| 457 | find_package(LibUSB) | ||
| 458 | endif() | ||
| 459 | |||
| 460 | if (LIBUSB_FOUND) | ||
| 461 | add_library(usb INTERFACE) | ||
| 462 | target_include_directories(usb INTERFACE "${LIBUSB_INCLUDEDIR}" "${LIBUSB_INCLUDE_DIRS}") | ||
| 463 | target_link_directories(usb INTERFACE "${LIBUSB_LIBRARY_DIRS}") | ||
| 464 | target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARIES}") | ||
| 465 | else() | ||
| 466 | message(WARNING "libusb not found, falling back to externals") | ||
| 467 | set(YUZU_USE_BUNDLED_LIBUSB ON) | ||
| 468 | endif() | ||
| 469 | endif() | ||
| 470 | |||
| 471 | # List of all FFmpeg components required | 453 | # List of all FFmpeg components required |
| 472 | set(FFmpeg_COMPONENTS | 454 | set(FFmpeg_COMPONENTS |
| 473 | avcodec | 455 | avcodec |