diff options
Diffstat (limited to '')
-rw-r--r-- | externals/CMakeLists.txt | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 94dd8bb62..0184289eb 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -8,15 +8,21 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) # Disable tests in all externals supporting the standard option name set(BUILD_TESTING OFF) +# Build only static externals +set(BUILD_SHARED_LIBS OFF) + +# Skip install rules for all externals +set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON) + # xbyak if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) - add_subdirectory(xbyak EXCLUDE_FROM_ALL) + add_subdirectory(xbyak) endif() # Dynarmic if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmic) set(DYNARMIC_IGNORE_ASSERTS ON) - add_subdirectory(dynarmic EXCLUDE_FROM_ALL) + add_subdirectory(dynarmic) add_library(dynarmic::dynarmic ALIAS dynarmic) endif() @@ -34,7 +40,7 @@ if (NOT TARGET inih::INIReader) endif() # mbedtls -add_subdirectory(mbedtls EXCLUDE_FROM_ALL) +add_subdirectory(mbedtls) target_include_directories(mbedtls PUBLIC ./mbedtls/include) # MicroProfile @@ -48,7 +54,7 @@ endif() # libusb if (ENABLE_LIBUSB AND NOT TARGET libusb::usb) - add_subdirectory(libusb EXCLUDE_FROM_ALL) + add_subdirectory(libusb) endif() # SDL2 @@ -57,8 +63,9 @@ if (YUZU_USE_EXTERNAL_SDL2) # Yuzu itself needs: Atomic Audio Events Joystick Haptic Sensor Threads Timers # Since 2.0.18 Atomic+Threads required for HIDAPI/libusb (see https://github.com/libsdl-org/SDL/issues/5095) # Yuzu-cmd also needs: Video (depends on Loadso/Dlopen) + # CPUinfo also required for SDL Audio, at least until 2.28.0 (see https://github.com/libsdl-org/SDL/issues/7809) set(SDL_UNUSED_SUBSYSTEMS - CPUinfo File Filesystem + File Filesystem Locale Power Render) foreach(_SUB ${SDL_UNUSED_SUBSYSTEMS}) string(TOUPPER ${_SUB} _OPT) @@ -67,18 +74,16 @@ if (YUZU_USE_EXTERNAL_SDL2) set(HIDAPI ON) endif() - set(SDL_STATIC ON) - set(SDL_SHARED OFF) if (APPLE) set(SDL_FILE ON) endif() - add_subdirectory(SDL EXCLUDE_FROM_ALL) + add_subdirectory(SDL) endif() # ENet if (NOT TARGET enet::enet) - add_subdirectory(enet EXCLUDE_FROM_ALL) + add_subdirectory(enet) target_include_directories(enet INTERFACE ./enet/include) add_library(enet::enet ALIAS enet) endif() @@ -86,62 +91,39 @@ endif() # Cubeb if (ENABLE_CUBEB AND NOT TARGET cubeb::cubeb) set(BUILD_TESTS OFF) - add_subdirectory(cubeb EXCLUDE_FROM_ALL) + set(BUILD_TOOLS OFF) + add_subdirectory(cubeb) add_library(cubeb::cubeb ALIAS cubeb) endif() # DiscordRPC if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc) - add_subdirectory(discord-rpc EXCLUDE_FROM_ALL) + set(BUILD_EXAMPLES OFF) + add_subdirectory(discord-rpc) target_include_directories(discord-rpc INTERFACE ./discord-rpc/include) add_library(DiscordRPC::discord-rpc ALIAS discord-rpc) endif() # Sirit -add_subdirectory(sirit EXCLUDE_FROM_ALL) +add_subdirectory(sirit) # httplib if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib) - if (NOT WIN32) - find_package(OpenSSL 1.1) - if (OPENSSL_FOUND) - set(OPENSSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) - endif() - endif() - - if (WIN32 OR NOT OPENSSL_FOUND) - # LibreSSL - set(LIBRESSL_SKIP_INSTALL ON) - set(OPENSSLDIR "/etc/ssl/") - add_subdirectory(libressl EXCLUDE_FROM_ALL) - target_include_directories(ssl INTERFACE ./libressl/include) - target_compile_definitions(ssl PRIVATE -DHAVE_INET_NTOP) - get_directory_property(OPENSSL_LIBRARIES - DIRECTORY libressl - DEFINITION OPENSSL_LIBS) - endif() - - add_library(httplib INTERFACE) - target_include_directories(httplib INTERFACE ./cpp-httplib) - target_compile_definitions(httplib INTERFACE -DCPPHTTPLIB_OPENSSL_SUPPORT) - target_link_libraries(httplib INTERFACE ${OPENSSL_LIBRARIES}) - if (WIN32) - target_link_libraries(httplib INTERFACE crypt32 cryptui ws2_32) - endif() - add_library(httplib::httplib ALIAS httplib) + set(HTTPLIB_REQUIRE_OPENSSL ON) + add_subdirectory(cpp-httplib) endif() # cpp-jwt if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt) - add_library(cpp-jwt INTERFACE) - target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include) - target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON) - add_library(cpp-jwt::cpp-jwt ALIAS cpp-jwt) + set(CPP_JWT_BUILD_EXAMPLES OFF) + set(CPP_JWT_BUILD_TESTS OFF) + set(CPP_JWT_USE_VENDORED_NLOHMANN_JSON OFF) + add_subdirectory(cpp-jwt) endif() # Opus if (NOT TARGET Opus::opus) - add_subdirectory(opus EXCLUDE_FROM_ALL) + add_subdirectory(opus) endif() # FFMpeg @@ -155,9 +137,28 @@ endif() # Vulkan-Headers if (YUZU_USE_EXTERNAL_VULKAN_HEADERS) - add_subdirectory(Vulkan-Headers EXCLUDE_FROM_ALL) + add_subdirectory(Vulkan-Headers) endif() -add_library(demangle STATIC) -target_include_directories(demangle PUBLIC ./demangle) -target_sources(demangle PRIVATE demangle/ItaniumDemangle.cpp) +# TZDB (Time Zone Database) +add_subdirectory(nx_tzdb) + +# VMA +add_library(vma vma/vma.cpp) +target_include_directories(vma PUBLIC ./vma/VulkanMemoryAllocator/include) +target_link_libraries(vma PRIVATE Vulkan::Headers) + +if (NOT TARGET LLVM::Demangle) + add_library(demangle demangle/ItaniumDemangle.cpp) + target_include_directories(demangle PUBLIC ./demangle) + add_library(LLVM::Demangle ALIAS demangle) +endif() + +add_library(stb stb/stb_dxt.cpp) +target_include_directories(stb PUBLIC ./stb) + +if (ANDROID) + if (ARCHITECTURE_arm64) + add_subdirectory(libadrenotools) + endif() +endif() |