diff options
Diffstat (limited to 'externals')
35 files changed, 143 insertions, 359 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 82e8ef18c..e80fd124e 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -1,4 +1,5 @@ -# Definitions for all external bundled libraries +# SPDX-FileCopyrightText: 2016 Citra Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules") list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/externals/find-modules") @@ -15,7 +16,6 @@ endif() # Dynarmic if (ARCHITECTURE_x86_64) - set(DYNARMIC_TESTS OFF) set(DYNARMIC_NO_BUNDLED_FMT ON) set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE) add_subdirectory(dynarmic) @@ -40,6 +40,11 @@ target_include_directories(mbedtls PUBLIC ./mbedtls/include) add_library(microprofile INTERFACE) target_include_directories(microprofile INTERFACE ./microprofile) +# GCC bugs +if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND MINGW) + target_compile_options(microprofile INTERFACE "-Wno-array-bounds") +endif() + # libusb if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB) add_subdirectory(libusb) @@ -68,8 +73,9 @@ if (YUZU_USE_EXTERNAL_SDL2) add_library(SDL2 ALIAS SDL2-static) endif() -# SoundTouch -add_subdirectory(soundtouch) +# ENet +add_subdirectory(enet) +target_include_directories(enet INTERFACE ./enet/include) # Cubeb if(ENABLE_CUBEB) @@ -110,13 +116,18 @@ if (ENABLE_WEB_SERVICE) if (WIN32) target_link_libraries(httplib INTERFACE crypt32 cryptui ws2_32) endif() + + # 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) endif() # Opus if (YUZU_USE_BUNDLED_OPUS) add_subdirectory(opus EXCLUDE_FROM_ALL) else() - find_package(opus 1.3 REQUIRED) + find_package(Opus 1.3 REQUIRED) endif() # FFMpeg diff --git a/externals/SDL b/externals/SDL -Subproject e2ade2bfc46d915cd306c63c830b81d800b2575 +Subproject b424665e0899769b200231ba943353a5fee1b6b diff --git a/externals/Vulkan-Headers b/externals/Vulkan-Headers -Subproject e005e1f8175d006adc3676b40ac3dd2212961a6 +Subproject 33d4dd987fc8fc6475ff9ca2b4f0c3cc6e79333 diff --git a/externals/cmake-modules/GetGitRevisionDescription.cmake b/externals/cmake-modules/GetGitRevisionDescription.cmake index 087f5deea..dab134775 100644 --- a/externals/cmake-modules/GetGitRevisionDescription.cmake +++ b/externals/cmake-modules/GetGitRevisionDescription.cmake @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2009 Iowa State University +# SPDX-FileContributor: Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> +# SPDX-License-Identifier: BSL-1.0 + # - Returns a version string from Git # # These functions force a re-configure on each git commit so that you can diff --git a/externals/cmake-modules/GetGitRevisionDescription.cmake.in b/externals/cmake-modules/GetGitRevisionDescription.cmake.in index 0d7eb3c26..868e032ef 100644 --- a/externals/cmake-modules/GetGitRevisionDescription.cmake.in +++ b/externals/cmake-modules/GetGitRevisionDescription.cmake.in @@ -1,4 +1,7 @@ -# +# SPDX-FileCopyrightText: 2009 Iowa State University +# SPDX-FileContributor: Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> +# SPDX-License-Identifier: BSL-1.0 + # Internal file for GetGitRevisionDescription.cmake # # Requires CMake 2.6 or newer (uses the 'function' command) diff --git a/externals/cmake-modules/WindowsCopyFiles.cmake b/externals/cmake-modules/WindowsCopyFiles.cmake index 72cec5354..08b598365 100644 --- a/externals/cmake-modules/WindowsCopyFiles.cmake +++ b/externals/cmake-modules/WindowsCopyFiles.cmake @@ -1,6 +1,5 @@ -# Copyright 2018 Yuzu Emulator Project -# Licensed under GPLv2 or any later version -# Refer to the license.txt file included. +# SPDX-FileCopyrightText: 2018 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later # This file provides the function windows_copy_files. # This is only valid on Windows. diff --git a/externals/cpp-httplib b/externals/cpp-httplib -Subproject 9648f950f5a8a41d18833cf4a85f5821b1bcac5 +Subproject 305a7abcb9b4e9e349843c6d563212e6c1bbbf2 diff --git a/externals/cpp-jwt b/externals/cpp-jwt new file mode 160000 +Subproject e12ef06218596b52d9b5d6e1639484866a8e706 diff --git a/externals/discord-rpc b/externals/discord-rpc -Subproject 963aa9f3e5ce81a4682c6ca3d136cddda614db3 +Subproject 20cc99aeffa08a4834f156b6ab49ed68618cf94 diff --git a/externals/dynarmic b/externals/dynarmic -Subproject a8cbfd9af4f3f3cdad6efcd067e76edec76c133 +Subproject 2d4602a6516c67d547000d4c80bcc5f74976abd diff --git a/externals/enet b/externals/enet new file mode 160000 +Subproject 39a72ab1990014eb399cee9d538fd529df99c6a diff --git a/externals/ffmpeg/CMakeLists.txt b/externals/ffmpeg/CMakeLists.txt index be8325b47..20ad716ea 100644 --- a/externals/ffmpeg/CMakeLists.txt +++ b/externals/ffmpeg/CMakeLists.txt @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2021 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + if (NOT WIN32) # Build FFmpeg from externals message(STATUS "Using FFmpeg from externals") @@ -214,6 +217,6 @@ else(WIN32) set(FFmpeg_LDFLAGS "${FFmpeg_LDFLAGS}" PARENT_SCOPE) set(FFmpeg_LIBRARIES "${FFmpeg_LIBRARIES}" PARENT_SCOPE) set(FFmpeg_INCLUDE_DIR "${FFmpeg_INCLUDE_DIR}" PARENT_SCOPE) -endif(WIN32) +endif() unset(FFmpeg_COMPONENTS) diff --git a/externals/ffmpeg/ffmpeg b/externals/ffmpeg/ffmpeg -Subproject dc91b913b6260e85e1304c74ff7bb3c22a8c9fb +Subproject 6b6b9e593dd4d3aaf75f48d40a13ef03bdef9fd diff --git a/externals/find-modules/FindCatch2.cmake b/externals/find-modules/FindCatch2.cmake deleted file mode 100644 index ce1d40bae..000000000 --- a/externals/find-modules/FindCatch2.cmake +++ /dev/null @@ -1,49 +0,0 @@ - -find_package(PkgConfig QUIET) -pkg_check_modules(PC_Catch2 QUIET Catch2) - -find_path(Catch2_INCLUDE_DIR - NAMES catch.hpp - PATHS ${PC_Catch2_INCLUDE_DIRS} ${CONAN_CATCH2_ROOT} - PATH_SUFFIXES catch2 -) - -if(Catch2_INCLUDE_DIR) - file(STRINGS "${Catch2_INCLUDE_DIR}/catch.hpp" _Catch2_version_lines - REGEX "#define[ \t]+CATCH_VERSION_(MAJOR|MINOR|PATCH)") - string(REGEX REPLACE ".*CATCH_VERSION_MAJOR +\([0-9]+\).*" "\\1" _Catch2_version_major "${_Catch2_version_lines}") - string(REGEX REPLACE ".*CATCH_VERSION_MINOR +\([0-9]+\).*" "\\1" _Catch2_version_minor "${_Catch2_version_lines}") - string(REGEX REPLACE ".*CATCH_VERSION_PATCH +\([0-9]+\).*" "\\1" _Catch2_version_patch "${_Catch2_version_lines}") - set(Catch2_VERSION "${_Catch2_version_major}.${_Catch2_version_minor}.${_Catch2_version_patch}") - unset(_Catch2_version_major) - unset(_Catch2_version_minor) - unset(_Catch2_version_patch) - unset(_Catch2_version_lines) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Catch2 - FOUND_VAR Catch2_FOUND - REQUIRED_VARS - Catch2_INCLUDE_DIR - Catch2_VERSION - VERSION_VAR Catch2_VERSION -) - -if(Catch2_FOUND) - set(Catch2_INCLUDE_DIRS ${Catch2_INCLUDE_DIR}) - set(Catch2_DEFINITIONS ${PC_Catch2_CFLAGS_OTHER}) -endif() - -if(Catch2_FOUND AND NOT TARGET Catch2::Catch2) - add_library(Catch2::Catch2 UNKNOWN IMPORTED) - set_target_properties(Catch2::Catch2 PROPERTIES - IMPORTED_LOCATION "${Catch2_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_Catch2_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${Catch2_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced( - Catch2_INCLUDE_DIR -) diff --git a/externals/find-modules/FindFFmpeg.cmake b/externals/find-modules/FindFFmpeg.cmake index 61b6dc8d2..add5b2c01 100644 --- a/externals/find-modules/FindFFmpeg.cmake +++ b/externals/find-modules/FindFFmpeg.cmake @@ -1,9 +1,9 @@ +# SPDX-FileCopyrightText: 2019 Citra Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + # FindFFmpeg # ---------- # -# Copyright 2019 Citra Emulator Project -# Licensed under GPLv2 or any later version -# # Find the native FFmpeg includes and libraries # # This module defines the following variables: diff --git a/externals/find-modules/FindLibUSB.cmake b/externals/find-modules/FindLibUSB.cmake index dec0b98b0..617daf9a5 100644 --- a/externals/find-modules/FindLibUSB.cmake +++ b/externals/find-modules/FindLibUSB.cmake @@ -1,11 +1,12 @@ +# SPDX-FileCopyrightText: 2009 Michal Cihar <michal@cihar.com> +# SPDX-License-Identifier: GPL-2.0-or-later + # - Find libusb-1.0 library # This module defines # LIBUSB_INCLUDE_DIR, where to find bluetooth.h # LIBUSB_LIBRARIES, the libraries needed to use libusb-1.0. # LIBUSB_FOUND, If false, do not try to use libusb-1.0. # -# Copyright (c) 2009, Michal Cihar, <michal@cihar.com> -# # vim: expandtab sw=4 ts=4 sts=4: if(ANDROID) diff --git a/externals/find-modules/FindOpus.cmake b/externals/find-modules/FindOpus.cmake new file mode 100644 index 000000000..b68a6046b --- /dev/null +++ b/externals/find-modules/FindOpus.cmake @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2022 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +find_package(PkgConfig) + +if (PKG_CONFIG_FOUND) + pkg_search_module(opus IMPORTED_TARGET GLOBAL opus) + if (opus_FOUND) + add_library(Opus::opus ALIAS PkgConfig::opus) + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Opus + REQUIRED_VARS + opus_LINK_LIBRARIES + opus_FOUND + VERSION_VAR opus_VERSION +) diff --git a/externals/find-modules/Findfmt.cmake b/externals/find-modules/Findfmt.cmake deleted file mode 100644 index 8ba51cbea..000000000 --- a/externals/find-modules/Findfmt.cmake +++ /dev/null @@ -1,69 +0,0 @@ - -find_package(PkgConfig QUIET) -pkg_check_modules(PC_fmt QUIET fmt) - -find_path(fmt_INCLUDE_DIR - NAMES format.h - PATHS ${PC_fmt_INCLUDE_DIRS} ${CONAN_INCLUDE_DIRS_fmt} - PATH_SUFFIXES fmt -) - -find_library(fmt_LIBRARY - NAMES fmt - PATHS ${PC_fmt_LIBRARY_DIRS} ${CONAN_LIB_DIRS_fmt} -) - -if(fmt_INCLUDE_DIR) - set(_fmt_version_file "${fmt_INCLUDE_DIR}/core.h") - if(NOT EXISTS "${_fmt_version_file}") - set(_fmt_version_file "${fmt_INCLUDE_DIR}/format.h") - endif() - if(EXISTS "${_fmt_version_file}") - # parse "#define FMT_VERSION 60200" to 6.2.0 - file(STRINGS "${_fmt_version_file}" fmt_VERSION_LINE - REGEX "^#define[ \t]+FMT_VERSION[ \t]+[0-9]+$") - string(REGEX REPLACE "^#define[ \t]+FMT_VERSION[ \t]+([0-9]+)$" - "\\1" fmt_VERSION "${fmt_VERSION_LINE}") - foreach(ver "fmt_VERSION_PATCH" "fmt_VERSION_MINOR" "fmt_VERSION_MAJOR") - math(EXPR ${ver} "${fmt_VERSION} % 100") - math(EXPR fmt_VERSION "(${fmt_VERSION} - ${${ver}}) / 100") - endforeach() - set(fmt_VERSION - "${fmt_VERSION_MAJOR}.${fmt_VERSION_MINOR}.${fmt_VERSION_PATCH}") - endif() - unset(_fmt_version_file) - unset(fmt_VERSION_LINE) - unset(fmt_VERSION_MAJOR) - unset(fmt_VERSION_MINOR) - unset(fmt_VERSION_PATCH) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(fmt - FOUND_VAR fmt_FOUND - REQUIRED_VARS - fmt_LIBRARY - fmt_INCLUDE_DIR - fmt_VERSION - VERSION_VAR fmt_VERSION -) - -if(fmt_FOUND) - set(fmt_LIBRARIES ${fmt_LIBRARY}) - set(fmt_INCLUDE_DIRS ${fmt_INCLUDE_DIR}) - set(fmt_DEFINITIONS ${PC_fmt_CFLAGS_OTHER}) -endif() - -if(fmt_FOUND AND NOT TARGET fmt::fmt) - add_library(fmt::fmt UNKNOWN IMPORTED) - set_target_properties(fmt::fmt PROPERTIES - IMPORTED_LOCATION "${fmt_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_fmt_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${fmt_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced( - fmt_INCLUDE_DIR - fmt_LIBRARY -) diff --git a/externals/find-modules/Findlz4.cmake b/externals/find-modules/Findlz4.cmake index 6279854c0..13ca5de66 100644 --- a/externals/find-modules/Findlz4.cmake +++ b/externals/find-modules/Findlz4.cmake @@ -1,54 +1,19 @@ +# SPDX-FileCopyrightText: 2022 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later -find_package(PkgConfig QUIET) -pkg_check_modules(PC_lz4 QUIET lz4) +find_package(PkgConfig) -find_path(lz4_INCLUDE_DIR - NAMES lz4.h - PATHS ${PC_lz4_INCLUDE_DIRS} -) -find_library(lz4_LIBRARY - NAMES lz4 - PATHS ${PC_lz4_LIBRARY_DIRS} -) - -if(lz4_INCLUDE_DIR) - file(STRINGS "${lz4_INCLUDE_DIR}/lz4.h" _lz4_version_lines - REGEX "#define[ \t]+LZ4_VERSION_(MAJOR|MINOR|RELEASE)") - string(REGEX REPLACE ".*LZ4_VERSION_MAJOR *\([0-9]*\).*" "\\1" _lz4_version_major "${_lz4_version_lines}") - string(REGEX REPLACE ".*LZ4_VERSION_MINOR *\([0-9]*\).*" "\\1" _lz4_version_minor "${_lz4_version_lines}") - string(REGEX REPLACE ".*LZ4_VERSION_RELEASE *\([0-9]*\).*" "\\1" _lz4_version_release "${_lz4_version_lines}") - set(lz4_VERSION "${_lz4_version_major}.${_lz4_version_minor}.${_lz4_version_release}") - unset(_lz4_version_major) - unset(_lz4_version_minor) - unset(_lz4_version_release) - unset(_lz4_version_lines) +if (PKG_CONFIG_FOUND) + pkg_search_module(liblz4 IMPORTED_TARGET GLOBAL liblz4) + if (liblz4_FOUND) + add_library(lz4::lz4 ALIAS PkgConfig::liblz4) + endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(lz4 - FOUND_VAR lz4_FOUND - REQUIRED_VARS - lz4_LIBRARY - lz4_INCLUDE_DIR - VERSION_VAR lz4_VERSION -) - -if(lz4_FOUND) - set(lz4_LIBRARIES ${lz4_LIBRARY}) - set(lz4_INCLUDE_DIRS ${lz4_INCLUDE_DIR}) - set(lz4_DEFINITIONS ${PC_lz4_CFLAGS_OTHER}) -endif() - -if(lz4_FOUND AND NOT TARGET lz4::lz4) - add_library(lz4::lz4 UNKNOWN IMPORTED) - set_target_properties(lz4::lz4 PROPERTIES - IMPORTED_LOCATION "${lz4_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_lz4_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${lz4_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced( - lz4_INCLUDE_DIR - lz4_LIBRARY + REQUIRED_VARS + liblz4_LINK_LIBRARIES + liblz4_FOUND + VERSION_VAR liblz4_VERSION ) diff --git a/externals/find-modules/Findnlohmann_json.cmake b/externals/find-modules/Findnlohmann_json.cmake deleted file mode 100644 index b0c5b3e4e..000000000 --- a/externals/find-modules/Findnlohmann_json.cmake +++ /dev/null @@ -1,49 +0,0 @@ - -find_package(PkgConfig QUIET) -pkg_check_modules(PC_nlohmann_json QUIET nlohmann_json) - -find_path(nlohmann_json_INCLUDE_DIR - NAMES json.hpp - PATHS ${PC_nlohmann_json_INCLUDE_DIRS} - PATH_SUFFIXES nlohmann -) - -if(nlohmann_json_INCLUDE_DIR) - file(STRINGS "${nlohmann_json_INCLUDE_DIR}/json.hpp" _nlohmann_json_version_lines - REGEX "#define[ \t]+NLOHMANN_JSON_VERSION_(MAJOR|MINOR|PATCH)") - string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_MAJOR +\([0-9]+\).*" "\\1" _nlohmann_json_version_major "${_nlohmann_json_version_lines}") - string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_MINOR +\([0-9]+\).*" "\\1" _nlohmann_json_version_minor "${_nlohmann_json_version_lines}") - string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_PATCH +\([0-9]+\).*" "\\1" _nlohmann_json_version_patch "${_nlohmann_json_version_lines}") - set(nlohmann_json_VERSION "${_nlohmann_json_version_major}.${_nlohmann_json_version_minor}.${_nlohmann_json_version_patch}") - unset(_nlohmann_json_version_major) - unset(_nlohmann_json_version_minor) - unset(_nlohmann_json_version_patch) - unset(_nlohmann_json_version_lines) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(nlohmann_json - FOUND_VAR nlohmann_json_FOUND - REQUIRED_VARS - nlohmann_json_INCLUDE_DIR - nlohmann_json_VERSION - VERSION_VAR nlohmann_json_VERSION -) - -if(nlohmann_json_FOUND) - set(nlohmann_json_INCLUDE_DIRS ${nlohmann_json_INCLUDE_DIR}) - set(nlohmann_json_DEFINITIONS ${PC_nlohmann_json_CFLAGS_OTHER}) -endif() - -if(nlohmann_json_FOUND AND NOT TARGET nlohmann_json::nlohmann_json) - add_library(nlohmann_json::nlohmann_json UNKNOWN IMPORTED) - set_target_properties(nlohmann_json::nlohmann_json PROPERTIES - IMPORTED_LOCATION "${nlohmann_json_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_nlohmann_json_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${nlohmann_json_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced( - nlohmann_json_INCLUDE_DIR -) diff --git a/externals/find-modules/Findopus.cmake b/externals/find-modules/Findopus.cmake deleted file mode 100644 index 2bce56122..000000000 --- a/externals/find-modules/Findopus.cmake +++ /dev/null @@ -1,42 +0,0 @@ - -find_package(PkgConfig QUIET) -pkg_check_modules(PC_opus QUIET opus) - -find_path(opus_INCLUDE_DIR - NAMES opus.h - PATHS ${PC_opus_INCLUDE_DIRS} - PATH_SUFFIXES opus -) -find_library(opus_LIBRARY - NAMES opus - PATHS ${PC_opus_LIBRARY_DIRS} -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(opus - FOUND_VAR opus_FOUND - REQUIRED_VARS - opus_LIBRARY - opus_INCLUDE_DIR - VERSION_VAR opus_VERSION -) - -if(opus_FOUND) - set(Opus_LIBRARIES ${opus_LIBRARY}) - set(Opus_INCLUDE_DIRS ${opus_INCLUDE_DIR}) - set(Opus_DEFINITIONS ${PC_opus_CFLAGS_OTHER}) -endif() - -if(opus_FOUND AND NOT TARGET Opus::Opus) - add_library(Opus::Opus UNKNOWN IMPORTED GLOBAL) - set_target_properties(Opus::Opus PROPERTIES - IMPORTED_LOCATION "${opus_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_opus_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${opus_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced( - opus_INCLUDE_DIR - opus_LIBRARY -) diff --git a/externals/find-modules/Findzstd.cmake b/externals/find-modules/Findzstd.cmake index 539abbafc..f4031eb70 100644 --- a/externals/find-modules/Findzstd.cmake +++ b/externals/find-modules/Findzstd.cmake @@ -1,55 +1,19 @@ +# SPDX-FileCopyrightText: 2022 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later -find_package(PkgConfig QUIET) -pkg_check_modules(PC_zstd QUIET libzstd) +find_package(PkgConfig) -find_path(zstd_INCLUDE_DIR - NAMES zstd.h - PATHS ${PC_zstd_INCLUDE_DIRS} -) -find_library(zstd_LIBRARY - NAMES zstd - PATHS ${PC_zstd_LIBRARY_DIRS} -) - -if(zstd_INCLUDE_DIR) - file(STRINGS "${zstd_INCLUDE_DIR}/zstd.h" _zstd_version_lines - REGEX "#define[ \t]+ZSTD_VERSION_(MAJOR|MINOR|RELEASE)") - string(REGEX REPLACE ".*ZSTD_VERSION_MAJOR *\([0-9]*\).*" "\\1" _zstd_version_major "${_zstd_version_lines}") - string(REGEX REPLACE ".*ZSTD_VERSION_MINOR *\([0-9]*\).*" "\\1" _zstd_version_minor "${_zstd_version_lines}") - string(REGEX REPLACE ".*ZSTD_VERSION_RELEASE *\([0-9]*\).*" "\\1" _zstd_version_release "${_zstd_version_lines}") - set(zstd_VERSION "${_zstd_version_major}.${_zstd_version_minor}.${_zstd_version_release}") - unset(_zstd_version_major) - unset(_zstd_version_minor) - unset(_zstd_version_release) - unset(_zstd_version_lines) +if (PKG_CONFIG_FOUND) + pkg_search_module(libzstd IMPORTED_TARGET GLOBAL libzstd) + if (libzstd_FOUND) + add_library(zstd::zstd ALIAS PkgConfig::libzstd) + endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(zstd - FOUND_VAR zstd_FOUND - REQUIRED_VARS - zstd_LIBRARY - zstd_INCLUDE_DIR - zstd_VERSION - VERSION_VAR zstd_VERSION -) - -if(zstd_FOUND) - set(zstd_LIBRARIES ${zstd_LIBRARY}) - set(zstd_INCLUDE_DIRS ${zstd_INCLUDE_DIR}) - set(zstd_DEFINITIONS ${PC_zstd_CFLAGS_OTHER}) -endif() - -if(zstd_FOUND AND NOT TARGET zstd::zstd) - add_library(zstd::zstd UNKNOWN IMPORTED) - set_target_properties(zstd::zstd PROPERTIES - IMPORTED_LOCATION "${zstd_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced( - zstd_INCLUDE_DIR - zstd_LIBRARY + REQUIRED_VARS + libzstd_LINK_LIBRARIES + libzstd_FOUND + VERSION_VAR libzstd_VERSION ) diff --git a/externals/getopt/CMakeLists.txt b/externals/getopt/CMakeLists.txt index ad7a2b363..4797fe01c 100644 --- a/externals/getopt/CMakeLists.txt +++ b/externals/getopt/CMakeLists.txt @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2015 Greg Wicks <gpwicks@email.wm.edu> +# SPDX-License-Identifier: GPL-2.0-or-later + add_library(getopt getopt.c getopt.h diff --git a/externals/glad/CMakeLists.txt b/externals/glad/CMakeLists.txt index c43ae475a..3dfcac2fd 100644 --- a/externals/glad/CMakeLists.txt +++ b/externals/glad/CMakeLists.txt @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2015 Yuri Kunde Schlesner <yuriks@yuriks.net> +# SPDX-License-Identifier: GPL-2.0-or-later + add_library(glad STATIC src/glad.c include/KHR/khrplatform.h diff --git a/externals/glad/Readme.md b/externals/glad/Readme.md index 7aad7fff2..998eec4a7 100644 --- a/externals/glad/Readme.md +++ b/externals/glad/Readme.md @@ -1,3 +1,8 @@ +<!-- +SPDX-FileCopyrightText: 2015 Yuri Kunde Schlesner <yuriks@yuriks.net> +SPDX-License-Identifier: GPL-2.0-or-later +--> + These files were generated by the [glad](https://github.com/Dav1dde/glad) OpenGL loader generator and have been checked in as-is. You can re-generate them using glad with the following command: ``` diff --git a/externals/inih/CMakeLists.txt b/externals/inih/CMakeLists.txt index 2a75852c2..b686e3cf5 100644 --- a/externals/inih/CMakeLists.txt +++ b/externals/inih/CMakeLists.txt @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014 Gui Andrade <admin@archshift.com> +# SPDX-License-Identifier: GPL-2.0-or-later + add_library(inih inih/ini.c inih/ini.h diff --git a/externals/libressl b/externals/libressl -Subproject 8289d0d07de6553bf4b900bf60e808ea3f7f59d +Subproject 8929f818fd748fd31a34fec7c04558399e13014 diff --git a/externals/libusb/CMakeLists.txt b/externals/libusb/CMakeLists.txt index 12bdc097a..055b89295 100644 --- a/externals/libusb/CMakeLists.txt +++ b/externals/libusb/CMakeLists.txt @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2020 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + if (MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR APPLE) set(LIBUSB_FOUND ON CACHE BOOL "libusb is present" FORCE) set(LIBUSB_VERSION "1.0.24" CACHE STRING "libusb version string" FORCE) diff --git a/externals/libusb/config.h.in b/externals/libusb/config.h.in index 915b7390f..42ae5a5e8 100644 --- a/externals/libusb/config.h.in +++ b/externals/libusb/config.h.in @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2020 yuzu Emulator Project + * SPDX-License-Identifier: GPL-2.0-or-later + */ + /* Default visibility */ #if defined(__GNUC__) || defined(__clang__) #define DEFAULT_VISIBILITY __attribute__((visibility("default"))) diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h index a06f6457d..639f3618c 100644 --- a/externals/microprofile/microprofile.h +++ b/externals/microprofile/microprofile.h @@ -1246,7 +1246,7 @@ struct MicroProfileScopeLock { bool bUseLock; std::recursive_mutex& m; - MicroProfileScopeLock(std::recursive_mutex& m) : bUseLock(g_bUseLock), m(m) + MicroProfileScopeLock(std::recursive_mutex& m_) : bUseLock(g_bUseLock), m(m_) { if(bUseLock) m.lock(); diff --git a/externals/microprofile/microprofileui.h b/externals/microprofile/microprofileui.h index 85fbf2cb9..1357a08fd 100644 --- a/externals/microprofile/microprofileui.h +++ b/externals/microprofile/microprofileui.h @@ -213,8 +213,8 @@ struct MicroProfileCustom struct SOptionDesc { - SOptionDesc(){} - SOptionDesc(uint8_t nSubType, uint8_t nIndex, const char* fmt, ...):nSubType(nSubType), nIndex(nIndex) + SOptionDesc()=default; + SOptionDesc(uint8_t nSubType_, uint8_t nIndex_, const char* fmt, ...):nSubType(nSubType_), nIndex(nIndex_) { va_list args; va_start (args, fmt); @@ -573,10 +573,10 @@ inline void MicroProfileToolTipMeta(MicroProfileStringArray* pToolTip) } else { - for(int i = 0; i < MICROPROFILE_META_MAX; ++i) + for(int k = 0; k < MICROPROFILE_META_MAX; ++k) { - nMetaSumInclusive[i] += nMetaSum[i]; - nMetaSum[i] = 0; + nMetaSumInclusive[k] += nMetaSum[k]; + nMetaSum[k] = 0; } } break; @@ -708,10 +708,10 @@ inline void MicroProfileDrawFloatTooltip(uint32_t nX, uint32_t nY, uint32_t nTok if(UI.nMouseLeftMod) { - int nIndex = (g_MicroProfileUI.LockedToolTipFront + MICROPROFILE_TOOLTIP_MAX_LOCKED - 1) % MICROPROFILE_TOOLTIP_MAX_LOCKED; - g_MicroProfileUI.nLockedToolTipColor[nIndex] = S.TimerInfo[nTimerId].nColor; - MicroProfileStringArrayCopy(&g_MicroProfileUI.LockedToolTips[nIndex], &ToolTip); - g_MicroProfileUI.LockedToolTipFront = nIndex; + int nToolTipIndex = (g_MicroProfileUI.LockedToolTipFront + MICROPROFILE_TOOLTIP_MAX_LOCKED - 1) % MICROPROFILE_TOOLTIP_MAX_LOCKED; + g_MicroProfileUI.nLockedToolTipColor[nToolTipIndex] = S.TimerInfo[nTimerId].nColor; + MicroProfileStringArrayCopy(&g_MicroProfileUI.LockedToolTips[nToolTipIndex], &ToolTip); + g_MicroProfileUI.LockedToolTipFront = nToolTipIndex; } } @@ -917,9 +917,8 @@ inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int float fStart = floor(fMsBase*fRcpStep) * fStep; for(float f = fStart; f < fMsEnd; ) { - float fStart = f; float fNext = f + fStep; - MicroProfileDrawBox(((fStart-fMsBase) * fMsToScreen), nBaseY, (fNext-fMsBase) * fMsToScreen+1, nBaseY + nHeight, UI.nOpacityBackground | g_nMicroProfileBackColors[nColorIndex++ & 1]); + MicroProfileDrawBox(((f-fMsBase) * fMsToScreen), nBaseY, (fNext-fMsBase) * fMsToScreen+1, nBaseY + nHeight, UI.nOpacityBackground | g_nMicroProfileBackColors[nColorIndex++ & 1]); f = fNext; } } @@ -1116,9 +1115,9 @@ inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nMaxStackDepth = MicroProfileMax(nMaxStackDepth, nStackPos); float fMsStart = fToMs * MicroProfileLogTickDifference(nBaseTicks, nTickStart); - float fMsEnd = fToMs * MicroProfileLogTickDifference(nBaseTicks, nTickEnd); + float fMsEnd2 = fToMs * MicroProfileLogTickDifference(nBaseTicks, nTickEnd); float fXStart = fMsStart * fMsToScreen; - float fXEnd = fMsEnd * fMsToScreen; + float fXEnd = fMsEnd2 * fMsToScreen; float fYStart = (float)(nY + nStackPos * nYDelta); float fYEnd = fYStart + (MICROPROFILE_DETAILED_BAR_HEIGHT); float fXDist = MicroProfileMax(fXStart - fMouseX, fMouseX - fXEnd); @@ -1269,22 +1268,22 @@ inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int if(UI.nRangeBegin != UI.nRangeEnd) { float fMsStart = fToMsCpu * MicroProfileLogTickDifference(nBaseTicksCpu, UI.nRangeBegin); - float fMsEnd = fToMsCpu * MicroProfileLogTickDifference(nBaseTicksCpu, UI.nRangeEnd); + float fMsEnd3 = fToMsCpu * MicroProfileLogTickDifference(nBaseTicksCpu, UI.nRangeEnd); float fXStart = fMsStart * fMsToScreen; - float fXEnd = fMsEnd * fMsToScreen; + float fXEnd = fMsEnd3 * fMsToScreen; MicroProfileDrawBox(fXStart, nBaseY, fXEnd, nHeight, MICROPROFILE_FRAME_COLOR_HIGHTLIGHT, MicroProfileBoxTypeFlat); MicroProfileDrawLineVertical(fXStart, nBaseY, nHeight, MICROPROFILE_FRAME_COLOR_HIGHTLIGHT | 0x44000000); MicroProfileDrawLineVertical(fXEnd, nBaseY, nHeight, MICROPROFILE_FRAME_COLOR_HIGHTLIGHT | 0x44000000); fMsStart += fDetailedOffset; - fMsEnd += fDetailedOffset; + fMsEnd3 += fDetailedOffset; char sBuffer[32]; uint32_t nLenStart = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsStart); float fStartTextWidth = (float)((1+MICROPROFILE_TEXT_WIDTH) * nLenStart); float fStartTextX = fXStart - fStartTextWidth - 2; MicroProfileDrawBox(fStartTextX, nBaseY, fStartTextX + fStartTextWidth + 2, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat); MicroProfileDrawText(fStartTextX+1, nBaseY, UINT32_MAX, sBuffer, nLenStart); - uint32_t nLenEnd = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsEnd); + uint32_t nLenEnd = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsEnd3); MicroProfileDrawBox(fXEnd+1, nBaseY, fXEnd+1+(1+MICROPROFILE_TEXT_WIDTH) * nLenEnd + 3, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat); MicroProfileDrawText(fXEnd+2, nBaseY+1, UINT32_MAX, sBuffer, nLenEnd); @@ -1297,9 +1296,9 @@ inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int if(UI.nRangeBeginGpu != UI.nRangeEndGpu) { float fMsStart = fToMsGpu * MicroProfileLogTickDifference(nBaseTicksGpu, UI.nRangeBeginGpu); - float fMsEnd = fToMsGpu * MicroProfileLogTickDifference(nBaseTicksGpu, UI.nRangeEndGpu); + float fMsEnd4 = fToMsGpu * MicroProfileLogTickDifference(nBaseTicksGpu, UI.nRangeEndGpu); float fXStart = fMsStart * fMsToScreen; - float fXEnd = fMsEnd * fMsToScreen; + float fXEnd = fMsEnd4 * fMsToScreen; MicroProfileDrawBox(fXStart, nBaseY, fXEnd, nHeight, MICROPROFILE_FRAME_COLOR_HIGHTLIGHT_GPU, MicroProfileBoxTypeFlat); MicroProfileDrawLineVertical(fXStart, nBaseY, nHeight, MICROPROFILE_FRAME_COLOR_HIGHTLIGHT_GPU | 0x44000000); MicroProfileDrawLineVertical(fXEnd, nBaseY, nHeight, MICROPROFILE_FRAME_COLOR_HIGHTLIGHT_GPU | 0x44000000); @@ -1307,14 +1306,14 @@ inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY += MICROPROFILE_TEXT_HEIGHT+1; fMsStart += fDetailedOffset; - fMsEnd += fDetailedOffset; + fMsEnd4 += fDetailedOffset; char sBuffer[32]; uint32_t nLenStart = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsStart); float fStartTextWidth = (float)((1+MICROPROFILE_TEXT_WIDTH) * nLenStart); float fStartTextX = fXStart - fStartTextWidth - 2; MicroProfileDrawBox(fStartTextX, nBaseY, fStartTextX + fStartTextWidth + 2, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat); MicroProfileDrawText(fStartTextX+1, nBaseY, UINT32_MAX, sBuffer, nLenStart); - uint32_t nLenEnd = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsEnd); + uint32_t nLenEnd = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsEnd4); MicroProfileDrawBox(fXEnd+1, nBaseY, fXEnd+1+(1+MICROPROFILE_TEXT_WIDTH) * nLenEnd + 3, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat); MicroProfileDrawText(fXEnd+2, nBaseY+1, UINT32_MAX, sBuffer, nLenEnd); } @@ -1716,8 +1715,8 @@ bool MicroProfileDrawGraph(uint32_t nScreenWidth, uint32_t nScreenHeight) uint32_t nTextCount = 0; uint32_t nGraphIndex = (S.nGraphPut + MICROPROFILE_GRAPH_HISTORY - int(MICROPROFILE_GRAPH_HISTORY*(1.f - fMouseXPrc))) % MICROPROFILE_GRAPH_HISTORY; - uint32_t nX = UI.nMouseX; - uint32_t nY = UI.nMouseY + 20; + uint32_t nMouseX = UI.nMouseX; + uint32_t nMouseY = UI.nMouseY + 20; for(uint32_t i = 0; i < MICROPROFILE_MAX_GRAPHS; ++i) { @@ -1736,7 +1735,7 @@ bool MicroProfileDrawGraph(uint32_t nScreenWidth, uint32_t nScreenHeight) } if(nTextCount) { - MicroProfileDrawFloatWindow(nX, nY, Strings.ppStrings, Strings.nNumStrings, 0, pColors); + MicroProfileDrawFloatWindow(nMouseX, nMouseY, Strings.ppStrings, Strings.nNumStrings, 0, pColors); } if(UI.nMouseRight) @@ -2321,8 +2320,8 @@ inline void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) uint32_t nMenuX[MICROPROFILE_MENU_MAX] = {0}; uint32_t nNumMenuItems = 0; - int nLen = snprintf(buffer, 127, "MicroProfile"); - MicroProfileDrawText(nX, nY, UINT32_MAX, buffer, nLen); + int nMPTextLen = snprintf(buffer, 127, "MicroProfile"); + MicroProfileDrawText(nX, nY, UINT32_MAX, buffer, nMPTextLen); nX += (sizeof("MicroProfile")+2) * (MICROPROFILE_TEXT_WIDTH+1); pMenuText[nNumMenuItems++] = "Mode"; pMenuText[nNumMenuItems++] = "Groups"; @@ -2438,16 +2437,16 @@ inline void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) int nNumLines = 0; bool bSelected = false; const char* pString = CB(nNumLines, &bSelected); - uint32_t nWidth = 0, nHeight = 0; + uint32_t nTextWidth = 0, nTextHeight = 0; while(pString) { - nWidth = MicroProfileMax<int>(nWidth, (int)strlen(pString)); + nTextWidth = MicroProfileMax<int>(nTextWidth, (int)strlen(pString)); nNumLines++; pString = CB(nNumLines, &bSelected); } - nWidth = (2+nWidth) * (MICROPROFILE_TEXT_WIDTH+1); - nHeight = nNumLines * (MICROPROFILE_TEXT_HEIGHT+1); - if(UI.nMouseY <= nY + nHeight+0 && UI.nMouseY >= nY-0 && UI.nMouseX <= nX + nWidth + 0 && UI.nMouseX >= nX - 0) + nTextWidth = (2+nTextWidth) * (MICROPROFILE_TEXT_WIDTH+1); + nTextHeight = nNumLines * (MICROPROFILE_TEXT_HEIGHT+1); + if(UI.nMouseY <= nY + nTextHeight+0 && UI.nMouseY >= nY-0 && UI.nMouseX <= nX + nTextWidth + 0 && UI.nMouseX >= nX - 0) { UI.nActiveMenu = nMenu; } @@ -2455,21 +2454,21 @@ inline void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) { UI.nActiveMenu = UINT32_MAX; } - MicroProfileDrawBox(nX, nY, nX + nWidth, nY + nHeight, 0xff000000|g_nMicroProfileBackColors[1]); + MicroProfileDrawBox(nX, nY, nX + nTextWidth, nY + nTextHeight, 0xff000000|g_nMicroProfileBackColors[1]); for(int i = 0; i < nNumLines; ++i) { - bool bSelected = false; - const char* pString = CB(i, &bSelected); + bool bSelected2 = false; + const char* pString2 = CB(i, &bSelected2); if(UI.nMouseY >= nY && UI.nMouseY < nY + MICROPROFILE_TEXT_HEIGHT + 1) { if(UI.nMouseLeft || UI.nMouseRight) { CBClick[nMenu](i); } - MicroProfileDrawBox(nX, nY, nX + nWidth, nY + MICROPROFILE_TEXT_HEIGHT + 1, 0xff888888); + MicroProfileDrawBox(nX, nY, nX + nTextWidth, nY + MICROPROFILE_TEXT_HEIGHT + 1, 0xff888888); } - int nLen = snprintf(buffer, SBUF_SIZE-1, "%c %s", bSelected ? '*' : ' ' ,pString); - MicroProfileDrawText(nX, nY, UINT32_MAX, buffer, nLen); + int nTextLen = snprintf(buffer, SBUF_SIZE-1, "%c %s", bSelected2 ? '*' : ' ' ,pString2); + MicroProfileDrawText(nX, nY, UINT32_MAX, buffer, nTextLen); nY += MICROPROFILE_TEXT_HEIGHT+1; } } @@ -2605,7 +2604,7 @@ inline void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight) for(uint32_t i = 0; i < nCount; ++i) { nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT); - uint32_t nWidth = MicroProfileMin(nMaxWidth, (uint32_t)(nMaxWidth * pMs[i] * fRcpReference)); + nWidth = MicroProfileMin(nMaxWidth, (uint32_t)(nMaxWidth * pMs[i] * fRcpReference)); MicroProfileDrawBox(nMaxOffsetX, nOffsetY, nMaxOffsetX+nWidth, nOffsetY+MICROPROFILE_TEXT_HEIGHT, pColors[i]|0xff000000); } } diff --git a/externals/opus/CMakeLists.txt b/externals/opus/CMakeLists.txt index 16f5af9f2..410ff7c08 100644 --- a/externals/opus/CMakeLists.txt +++ b/externals/opus/CMakeLists.txt @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + cmake_minimum_required(VERSION 3.8) project(opus) @@ -253,4 +256,4 @@ PRIVATE opus/src ) -add_library(Opus::Opus ALIAS opus) +add_library(Opus::opus ALIAS opus) diff --git a/externals/sirit b/externals/sirit -Subproject a39596358a3a5488c06554c0c15184a6af71e43 +Subproject aa292d56650bc28f2b2d75973fab2e61d0136f9 diff --git a/externals/soundtouch b/externals/soundtouch deleted file mode 160000 -Subproject 060181eaf273180d3a7e87349895bd0cb6ccbf4 diff --git a/externals/vcpkg b/externals/vcpkg new file mode 160000 +Subproject 9b22b40c6c61bf0da2d46346dd44a11e90972cc |