forked from dolphin-emu/dolphin
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'upstream-master' into upstream-merge-2023-09-06
- Loading branch information
Showing
1,664 changed files
with
186,156 additions
and
216,470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Based on CMake's FindIconv.cmake | ||
# Modified to prefer non-built-in iconv over the built-in one | ||
# See https://gitlab.kitware.com/cmake/cmake/-/issues/24695 for details | ||
# This file can be deleted once that issue has been closed and the fix has | ||
# made it into a satisfactory number of cmake versions. FreeBSD is the only | ||
# system known to hit this so far, so "satisfactory" can probably be defined | ||
# as "enough that most FreeBSD users have a fixed cmake". | ||
|
||
find_path(Iconv_INCLUDE_DIR | ||
NAMES "iconv.h" | ||
DOC "iconv include directory") | ||
mark_as_advanced(Iconv_INCLUDE_DIR) | ||
|
||
find_library(Iconv_LIBRARY | ||
NAMES iconv libiconv | ||
NAMES_PER_DIR | ||
DOC "iconv library (if not in the C library)") | ||
mark_as_advanced(Iconv_LIBRARY) | ||
|
||
# iconv can only be provided in libc on a POSIX system. | ||
if(UNIX AND (NOT Iconv_INCLUDE_DIR OR NOT Iconv_LIBRARY)) | ||
include(CMakePushCheckState) | ||
include(CheckCXXSourceCompiles) | ||
cmake_push_check_state(RESET) | ||
# We always suppress the message here: Otherwise on supported systems | ||
# not having iconv in their C library (e.g. those using libiconv) | ||
# would always display a confusing "Looking for iconv - not found" message | ||
set(CMAKE_FIND_QUIETLY TRUE) | ||
# The following code will not work, but it's sufficient to see if it compiles. | ||
# Note: libiconv will define the iconv functions as macros, so CheckSymbolExists | ||
# will not yield correct results. | ||
set(Iconv_IMPLICIT_TEST_CODE | ||
" | ||
#include <stddef.h> | ||
#include <iconv.h> | ||
int main() { | ||
char *a, *b; | ||
size_t i, j; | ||
iconv_t ic; | ||
ic = iconv_open(\"to\", \"from\"); | ||
iconv(ic, &a, &i, &b, &j); | ||
iconv_close(ic); | ||
} | ||
" | ||
) | ||
check_cxx_source_compiles("${Iconv_IMPLICIT_TEST_CODE}" Iconv_IS_BUILT_IN) | ||
cmake_pop_check_state() | ||
if(Iconv_IS_BUILT_IN) | ||
unset(Iconv_INCLUDE_DIR) | ||
unset(Iconv_LIBRARY) | ||
endif() | ||
else() | ||
set(Iconv_IS_BUILT_IN FALSE) | ||
endif() | ||
|
||
set(_Iconv_REQUIRED_VARS) | ||
if(Iconv_IS_BUILT_IN) | ||
set(_Iconv_REQUIRED_VARS _Iconv_IS_BUILT_IN_MSG) | ||
set(_Iconv_IS_BUILT_IN_MSG "built in to C library") | ||
else() | ||
set(_Iconv_REQUIRED_VARS Iconv_LIBRARY Iconv_INCLUDE_DIR) | ||
endif() | ||
|
||
# NOTE: glibc's iconv.h does not define _LIBICONV_VERSION | ||
if(Iconv_INCLUDE_DIR AND EXISTS "${Iconv_INCLUDE_DIR}/iconv.h") | ||
file(STRINGS ${Iconv_INCLUDE_DIR}/iconv.h Iconv_VERSION_DEFINE REGEX "_LIBICONV_VERSION (.*)") | ||
|
||
if(Iconv_VERSION_DEFINE MATCHES "(0x[A-Fa-f0-9]+)") | ||
set(Iconv_VERSION_NUMBER "${CMAKE_MATCH_1}") | ||
# encoding -> version number: (major<<8) + minor | ||
math(EXPR Iconv_VERSION_MAJOR "${Iconv_VERSION_NUMBER} >> 8" OUTPUT_FORMAT HEXADECIMAL) | ||
math(EXPR Iconv_VERSION_MINOR "${Iconv_VERSION_NUMBER} - (${Iconv_VERSION_MAJOR} << 8)" OUTPUT_FORMAT HEXADECIMAL) | ||
|
||
math(EXPR Iconv_VERSION_MAJOR "${Iconv_VERSION_MAJOR}" OUTPUT_FORMAT DECIMAL) | ||
math(EXPR Iconv_VERSION_MINOR "${Iconv_VERSION_MINOR}" OUTPUT_FORMAT DECIMAL) | ||
set(Iconv_VERSION "${Iconv_VERSION_MAJOR}.${Iconv_VERSION_MINOR}") | ||
endif() | ||
|
||
unset(Iconv_VERSION_DEFINE) | ||
unset(Iconv_VERSION_NUMBER) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Iconv | ||
REQUIRED_VARS ${_Iconv_REQUIRED_VARS} | ||
VERSION_VAR Iconv_VERSION) | ||
|
||
if(Iconv_FOUND) | ||
if(Iconv_IS_BUILT_IN) | ||
set(Iconv_INCLUDE_DIRS "") | ||
set(Iconv_LIBRARIES "") | ||
else() | ||
set(Iconv_INCLUDE_DIRS "${Iconv_INCLUDE_DIR}") | ||
set(Iconv_LIBRARIES "${Iconv_LIBRARY}") | ||
endif() | ||
if(NOT TARGET Iconv::Iconv) | ||
add_library(Iconv::Iconv INTERFACE IMPORTED) | ||
set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${Iconv_INCLUDE_DIRS}") | ||
set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES "${Iconv_LIBRARIES}") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
find_path(LZO_INCLUDE_DIR lzo/lzo1x.h) | ||
find_library(LZO_LIBRARY lzo2) | ||
mark_as_advanced(LZO_INCLUDE_DIR LZO_LIBRARY) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LZO DEFAULT_MSG | ||
LZO_INCLUDE_DIR LZO_LIBRARY) | ||
|
||
if(LZO_FOUND AND NOT TARGET LZO::LZO) | ||
add_library(LZO::LZO UNKNOWN IMPORTED) | ||
set_target_properties(LZO::LZO PROPERTIES | ||
IMPORTED_LOCATION "${LZO_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${LZO_INCLUDE_DIR}" | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,59 @@ | ||
find_path(MBEDTLS_INCLUDE_DIR mbedtls/ssl.h) | ||
find_path(MBEDTLS_INCLUDE_DIR mbedtls/ssl.h PATH_SUFFIXES mbedtls2) | ||
|
||
find_library(MBEDTLS_LIBRARY mbedtls) | ||
find_library(MBEDX509_LIBRARY mbedx509) | ||
find_library(MBEDCRYPTO_LIBRARY mbedcrypto) | ||
find_library(MBEDTLS_LIBRARY mbedtls PATH_SUFFIXES mbedtls2) | ||
find_library(MBEDX509_LIBRARY mbedx509 PATH_SUFFIXES mbedtls2) | ||
find_library(MBEDCRYPTO_LIBRARY mbedcrypto PATH_SUFFIXES mbedtls2) | ||
|
||
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR}) | ||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY}) | ||
|
||
set(CMAKE_REQUIRED_INCLUDES ${MBEDTLS_INCLUDE_DIRS}) | ||
check_cxx_source_compiles(" | ||
#include <mbedtls/version.h> | ||
#if MBEDTLS_VERSION_NUMBER < 0x021C0000 | ||
#error \"Your mbed TLS version is too old.\" | ||
#endif | ||
int main() {}" | ||
MBEDTLS_VERSION_OK) | ||
if(NOT MBEDTLS_INCLUDE_DIR STREQUAL "MBEDTLS_INCLUDE_DIR-NOTFOUND") | ||
if(EXISTS ${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h) | ||
file(STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h MBEDTLS_VERSION_STR REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*") | ||
else() | ||
file(STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLS_VERSION_STR REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*") | ||
endif() | ||
string(REGEX REPLACE "^#define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"([.0-9]+)\".*" "\\1" MBEDTLS_VERSION ${MBEDTLS_VERSION_STR}) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(MBEDTLS DEFAULT_MSG | ||
MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY MBEDTLS_VERSION_OK) | ||
if(NOT MBEDTLS_INCLUDE_DIR STREQUAL "MBEDTLS_INCLUDE_DIR-NOTFOUND" AND MBEDTLS_VERSION VERSION_GREATER_EQUAL 3) | ||
# Once CMake 3.19 is required, we can enable HANDLE_VERSION_RANGE and use that | ||
if(MBEDTLS_FIND_REQUIRED) | ||
set(type FATAL_ERROR) | ||
else() | ||
set(type STATUS) | ||
endif() | ||
if(MBEDTLS_FIND_REQUIRED OR NOT MBEDTLS_FIND_QUIETLY) | ||
message(${type} "Could NOT find MBEDTLS: Found unsuitable version \"${MBEDTLS_VERSION}\", but a 2.x version is required (found ${MBEDTLS_INCLUDE_DIR})") | ||
endif() | ||
set(MBEDTLS_FOUND FALSE) | ||
else() | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(MBEDTLS | ||
REQUIRED_VARS MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY | ||
VERSION_VAR MBEDTLS_VERSION) | ||
endif() | ||
|
||
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) | ||
|
||
if(MBEDTLS_FOUND) | ||
add_library(MbedTLS::mbedcrypto UNKNOWN IMPORTED) | ||
set_target_properties(MbedTLS::mbedcrypto PROPERTIES | ||
IMPORTED_LOCATION "${MBEDCRYPTO_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}" | ||
) | ||
|
||
add_library(MbedTLS::mbedx509 UNKNOWN IMPORTED) | ||
set_target_properties(MbedTLS::mbedx509 PROPERTIES | ||
IMPORTED_LOCATION "${MBEDX509_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}" | ||
INTERFACE_LINK_LIBRARIES MbedTLS::mbedcrypto | ||
) | ||
|
||
add_library(MbedTLS::mbedtls UNKNOWN IMPORTED) | ||
set_target_properties(MbedTLS::mbedtls PROPERTIES | ||
IMPORTED_LOCATION "${MBEDTLS_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}" | ||
INTERFACE_LINK_LIBRARIES MbedTLS::mbedx509 | ||
) | ||
endif() |
Oops, something went wrong.