[cmake, core] refactor: update mbedtls and make YUZU_USE_CPM better (#485)

update mbedtls functors to support mbedtls3 signatures

moved some vulkan stuff from externals to root, yuzu_use_cpm manages
them now

needs testing:
- all key/derivation related things
- nca verification
- game loading/updates/stuff

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/485
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
crueter 2025-09-15 04:22:15 +02:00
parent 28d26b0d76
commit d207df959a
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
16 changed files with 114 additions and 139 deletions

View file

@ -54,36 +54,27 @@ endif()
# Glad
add_subdirectory(glad)
# mbedtls
AddJsonPackage(mbedtls)
if (mbedtls_ADDED)
target_include_directories(mbedtls PUBLIC ${mbedtls_SOURCE_DIR}/include)
if (NOT MSVC)
target_compile_options(mbedcrypto PRIVATE
-Wno-unused-but-set-variable
-Wno-string-concatenation
)
elseif(CXX_CLANG)
foreach(TARGET mbedtls mbedcrypto mbedx509)
target_compile_options(${TARGET} PRIVATE
-w
)
endforeach()
endif()
endif()
# libusb
if (ENABLE_LIBUSB)
add_subdirectory(libusb)
endif()
# Sirit
# TODO(crueter): spirv-tools doesn't work w/ system
set(SPIRV_WERROR OFF)
AddJsonPackage(spirv-headers)
# VMA
AddJsonPackage(vulkan-memory-allocator)
if (VulkanMemoryAllocator_ADDED)
if (CXX_CLANG)
target_compile_options(VulkanMemoryAllocator INTERFACE
-Wno-unused-variable
)
elseif(MSVC)
target_compile_options(VulkanMemoryAllocator INTERFACE
/wd4189
)
endif()
endif()
# Sirit
AddJsonPackage(sirit)
if(MSVC AND USE_CCACHE AND sirit_ADDED)
@ -117,46 +108,9 @@ if (YUZU_USE_BUNDLED_FFMPEG)
set(FFmpeg_INCLUDE_DIR "${FFmpeg_INCLUDE_DIR}" PARENT_SCOPE)
endif()
# VulkanUtilityHeaders - pulls in headers and utility libs
AddJsonPackage(
NAME vulkan-utility-headers
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES}
)
# small hack
if (NOT VulkanUtilityLibraries_ADDED)
find_package(VulkanHeaders 1.3.274 REQUIRED)
endif()
# SPIRV Tools
AddJsonPackage(
NAME spirv-tools
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS}
)
if (SPIRV-Tools_ADDED)
add_library(SPIRV-Tools::SPIRV-Tools ALIAS SPIRV-Tools-static)
target_link_libraries(SPIRV-Tools-static PRIVATE SPIRV-Tools-opt SPIRV-Tools-link)
endif()
# TZDB (Time Zone Database)
add_subdirectory(nx_tzdb)
# VMA
AddJsonPackage(vulkan-memory-allocator)
if (VulkanMemoryAllocator_ADDED)
if (CXX_CLANG)
target_compile_options(VulkanMemoryAllocator INTERFACE
-Wno-unused-variable
)
elseif(MSVC)
target_compile_options(VulkanMemoryAllocator INTERFACE
/wd4189
)
endif()
endif()
if (NOT TARGET LLVM::Demangle)
add_library(demangle demangle/ItaniumDemangle.cpp)
target_include_directories(demangle PUBLIC ./demangle)