build: use system MbedTLS when available
Since MbedTLS pre-3.0.0 doesn't ship neither a pkg-config file nor a CMake package config file it is required to use a custom FindMbedTLS.cmake file. Since yuzu requires CMAC support it is also needed to check for the `mbedtls_cipher_cmac` symbol. I also changed src/core/CMakeLists.txt to only link against mbedcrypto, as yuzu doesn't use the full MbedTLS library
This commit is contained in:
11
externals/CMakeLists.txt
vendored
11
externals/CMakeLists.txt
vendored
@@ -30,9 +30,14 @@ if (NOT TARGET inih::INIReader)
|
||||
add_subdirectory(inih)
|
||||
endif()
|
||||
|
||||
# mbedtls
|
||||
add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
|
||||
target_include_directories(mbedtls PUBLIC ./mbedtls/include)
|
||||
# MbedTLS
|
||||
find_package(MbedTLS 2.16)
|
||||
if(NOT MbedTLS_FOUND)
|
||||
message(STATUS "MbedTLS not found, falling back to externals")
|
||||
add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
|
||||
target_include_directories(mbedcrypto PUBLIC ./mbedtls/include)
|
||||
add_library(MbedTLS::mbedcrypto ALIAS mbedcrypto)
|
||||
endif()
|
||||
|
||||
# MicroProfile
|
||||
add_library(microprofile INTERFACE)
|
||||
|
||||
Reference in New Issue
Block a user