diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bef9d6ed..166024844 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -11,7 +11,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modul | |||
| 11 | include(DownloadExternals) | 11 | include(DownloadExternals) |
| 12 | include(CMakeDependentOption) | 12 | include(CMakeDependentOption) |
| 13 | include(CTest) | 13 | include(CTest) |
| 14 | include(FetchContent) | ||
| 15 | 14 | ||
| 16 | # Set bundled sdl2/qt as dependent options. | 15 | # Set bundled sdl2/qt as dependent options. |
| 17 | # OFF by default, but if ENABLE_SDL2 and MSVC are true then ON | 16 | # OFF by default, but if ENABLE_SDL2 and MSVC are true then ON |
| @@ -99,47 +98,8 @@ if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL) | |||
| 99 | DESTINATION "${vvl_lib_path}") | 98 | DESTINATION "${vvl_lib_path}") |
| 100 | endif() | 99 | endif() |
| 101 | 100 | ||
| 102 | # On Android, fetch and compile libcxx before doing anything else | ||
| 103 | if (ANDROID) | 101 | if (ANDROID) |
| 104 | set(CMAKE_SKIP_INSTALL_RULES ON) | 102 | set(CMAKE_SKIP_INSTALL_RULES ON) |
| 105 | set(LLVM_VERSION "15.0.6") | ||
| 106 | |||
| 107 | # Note: even though libcxx and libcxxabi have separate releases on the project page, | ||
| 108 | # the separated releases cannot be compiled. Only in-tree builds work. Therefore we | ||
| 109 | # must fetch the source release for the entire llvm tree. | ||
| 110 | FetchContent_Declare(llvm | ||
| 111 | URL "https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz" | ||
| 112 | URL_HASH SHA256=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92 | ||
| 113 | TLS_VERIFY TRUE | ||
| 114 | ) | ||
| 115 | FetchContent_MakeAvailable(llvm) | ||
| 116 | |||
| 117 | # libcxx has support for most of the range library, but it's gated behind a flag: | ||
| 118 | add_compile_definitions(_LIBCPP_ENABLE_EXPERIMENTAL) | ||
| 119 | |||
| 120 | # Disable standard header inclusion | ||
| 121 | set(ANDROID_STL "none") | ||
| 122 | |||
| 123 | # libcxxabi | ||
| 124 | set(LIBCXXABI_INCLUDE_TESTS OFF) | ||
| 125 | set(LIBCXXABI_ENABLE_SHARED FALSE) | ||
| 126 | set(LIBCXXABI_ENABLE_STATIC TRUE) | ||
| 127 | set(LIBCXXABI_LIBCXX_INCLUDES "${LIBCXX_TARGET_INCLUDE_DIRECTORY}" CACHE STRING "" FORCE) | ||
| 128 | add_subdirectory("${llvm_SOURCE_DIR}/libcxxabi" "${llvm_BINARY_DIR}/libcxxabi") | ||
| 129 | link_libraries(cxxabi_static) | ||
| 130 | |||
| 131 | # libcxx | ||
| 132 | set(LIBCXX_ABI_NAMESPACE "__ndk1" CACHE STRING "" FORCE) | ||
| 133 | set(LIBCXX_CXX_ABI "libcxxabi") | ||
| 134 | set(LIBCXX_INCLUDE_TESTS OFF) | ||
| 135 | set(LIBCXX_INCLUDE_BENCHMARKS OFF) | ||
| 136 | set(LIBCXX_INCLUDE_DOCS OFF) | ||
| 137 | set(LIBCXX_ENABLE_SHARED FALSE) | ||
| 138 | set(LIBCXX_ENABLE_STATIC TRUE) | ||
| 139 | set(LIBCXX_ENABLE_ASSERTIONS FALSE) | ||
| 140 | add_subdirectory("${llvm_SOURCE_DIR}/libcxx" "${llvm_BINARY_DIR}/libcxx") | ||
| 141 | set_target_properties(cxx-headers PROPERTIES INTERFACE_COMPILE_OPTIONS "-isystem${CMAKE_BINARY_DIR}/${LIBCXX_INSTALL_INCLUDE_DIR}") | ||
| 142 | link_libraries(cxx_static cxx-headers) | ||
| 143 | endif() | 103 | endif() |
| 144 | 104 | ||
| 145 | if (YUZU_USE_BUNDLED_VCPKG) | 105 | if (YUZU_USE_BUNDLED_VCPKG) |
| @@ -329,7 +289,7 @@ find_package(Boost 1.79.0 REQUIRED context) | |||
| 329 | find_package(enet 1.3 MODULE) | 289 | find_package(enet 1.3 MODULE) |
| 330 | find_package(fmt 9 REQUIRED) | 290 | find_package(fmt 9 REQUIRED) |
| 331 | find_package(inih 52 MODULE COMPONENTS INIReader) | 291 | find_package(inih 52 MODULE COMPONENTS INIReader) |
| 332 | find_package(LLVM 17 MODULE COMPONENTS Demangle) | 292 | find_package(LLVM 17.0.2 MODULE COMPONENTS Demangle) |
| 333 | find_package(lz4 REQUIRED) | 293 | find_package(lz4 REQUIRED) |
| 334 | find_package(nlohmann_json 3.8 REQUIRED) | 294 | find_package(nlohmann_json 3.8 REQUIRED) |
| 335 | find_package(Opus 1.3 MODULE) | 295 | find_package(Opus 1.3 MODULE) |
| @@ -400,6 +360,9 @@ function(set_yuzu_qt_components) | |||
| 400 | if (ENABLE_QT_TRANSLATION) | 360 | if (ENABLE_QT_TRANSLATION) |
| 401 | list(APPEND YUZU_QT_COMPONENTS2 LinguistTools) | 361 | list(APPEND YUZU_QT_COMPONENTS2 LinguistTools) |
| 402 | endif() | 362 | endif() |
| 363 | if (USE_DISCORD_PRESENCE) | ||
| 364 | list(APPEND YUZU_QT_COMPONENTS2 Network) | ||
| 365 | endif() | ||
| 403 | set(YUZU_QT_COMPONENTS ${YUZU_QT_COMPONENTS2} PARENT_SCOPE) | 366 | set(YUZU_QT_COMPONENTS ${YUZU_QT_COMPONENTS2} PARENT_SCOPE) |
| 404 | endfunction(set_yuzu_qt_components) | 367 | endfunction(set_yuzu_qt_components) |
| 405 | 368 | ||