diff options
Diffstat (limited to '')
-rw-r--r-- | externals/CMakeLists.txt | 126 | ||||
m--------- | externals/SDL | 0 | ||||
m--------- | externals/Vulkan-Headers | 0 | ||||
m--------- | externals/VulkanMemoryAllocator | 0 | ||||
m--------- | externals/breakpad | 0 | ||||
m--------- | externals/cpp-httplib | 0 | ||||
m--------- | externals/cpp-jwt | 0 | ||||
m--------- | externals/dynarmic | 0 | ||||
m--------- | externals/ffmpeg/ffmpeg | 0 | ||||
-rw-r--r-- | externals/gamemode/gamemode_client.h | 376 | ||||
-rw-r--r-- | externals/inih/CMakeLists.txt | 13 | ||||
m--------- | externals/inih/inih | 0 | ||||
-rw-r--r-- | externals/libusb/CMakeLists.txt | 7 | ||||
m--------- | externals/libusb/libusb | 0 | ||||
m--------- | externals/nx_tzdb/tzdb_to_nx | 0 | ||||
m--------- | externals/oaknut | 0 | ||||
m--------- | externals/opus | 0 | ||||
-rw-r--r-- | externals/opus/CMakeLists.txt | 259 | ||||
m--------- | externals/opus/opus | 0 | ||||
m--------- | externals/simpleini | 0 | ||||
m--------- | externals/vcpkg | 0 |
21 files changed, 497 insertions, 284 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 6e5bfbba6..407c5c640 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -20,6 +20,10 @@ if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) endif() # Dynarmic +if (ARCHITECTURE_arm64 AND NOT TARGET merry::oaknut) + add_subdirectory(oaknut) +endif() + if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmic) set(DYNARMIC_IGNORE_ASSERTS ON) add_subdirectory(dynarmic) @@ -34,11 +38,6 @@ endif() # Glad add_subdirectory(glad) -# inih -if (NOT TARGET inih::INIReader) - add_subdirectory(inih) -endif() - # mbedtls add_subdirectory(mbedtls) target_include_directories(mbedtls PUBLIC ./mbedtls/include) @@ -134,6 +133,10 @@ endif() # Opus if (NOT TARGET Opus::opus) + set(OPUS_BUILD_TESTING OFF) + set(OPUS_BUILD_PROGRAMS OFF) + set(OPUS_INSTALL_PKG_CONFIG_MODULE OFF) + set(OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF) add_subdirectory(opus) endif() @@ -189,3 +192,116 @@ if (ANDROID) add_subdirectory(libadrenotools) endif() endif() + +if (UNIX AND NOT APPLE AND NOT TARGET gamemode::headers) + add_library(gamemode INTERFACE) + target_include_directories(gamemode INTERFACE gamemode) + add_library(gamemode::headers ALIAS gamemode) +endif() + +# Breakpad +# https://github.com/microsoft/vcpkg/blob/master/ports/breakpad/CMakeLists.txt +if (YUZU_CRASH_DUMPS AND NOT TARGET libbreakpad_client) + set(BREAKPAD_WIN32_DEFINES + NOMINMAX + UNICODE + WIN32_LEAN_AND_MEAN + _CRT_SECURE_NO_WARNINGS + _CRT_SECURE_NO_DEPRECATE + _CRT_NONSTDC_NO_DEPRECATE + ) + + # libbreakpad + add_library(libbreakpad STATIC) + file(GLOB_RECURSE LIBBREAKPAD_SOURCES breakpad/src/processor/*.cc) + file(GLOB_RECURSE LIBDISASM_SOURCES breakpad/src/third_party/libdisasm/*.c) + list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX "_unittest|_selftest|synth_minidump|/tests|/testdata|/solaris|microdump_stackwalk|minidump_dump|minidump_stackwalk") + if (WIN32) + list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX "/linux|/mac|/android") + target_compile_definitions(libbreakpad PRIVATE ${BREAKPAD_WIN32_DEFINES}) + target_include_directories(libbreakpad PRIVATE "${CMAKE_GENERATOR_INSTANCE}/DIA SDK/include") + elseif (APPLE) + list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX "/linux|/windows|/android") + else() + list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX "/mac|/windows|/android") + endif() + target_sources(libbreakpad PRIVATE ${LIBBREAKPAD_SOURCES} ${LIBDISASM_SOURCES}) + target_include_directories(libbreakpad + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/breakpad/src + ${CMAKE_CURRENT_SOURCE_DIR}/breakpad/src/third_party/libdisasm + ) + + # libbreakpad_client + add_library(libbreakpad_client STATIC) + file(GLOB LIBBREAKPAD_COMMON_SOURCES breakpad/src/common/*.cc breakpad/src/common/*.c breakpad/src/client/*.cc) + + if (WIN32) + file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES breakpad/src/client/windows/*.cc breakpad/src/common/windows/*.cc) + list(FILTER LIBBREAKPAD_COMMON_SOURCES EXCLUDE REGEX "language.cc|path_helper.cc|stabs_to_module.cc|stabs_reader.cc|minidump_file_writer.cc") + target_include_directories(libbreakpad_client PRIVATE "${CMAKE_GENERATOR_INSTANCE}/DIA SDK/include") + target_compile_definitions(libbreakpad_client PRIVATE ${BREAKPAD_WIN32_DEFINES}) + elseif (APPLE) + target_compile_definitions(libbreakpad_client PRIVATE HAVE_MACH_O_NLIST_H) + file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES breakpad/src/client/mac/*.cc breakpad/src/common/mac/*.cc) + list(APPEND LIBBREAKPAD_CLIENT_SOURCES breakpad/src/common/mac/MachIPC.mm) + else() + target_compile_definitions(libbreakpad_client PUBLIC -DHAVE_A_OUT_H) + file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES breakpad/src/client/linux/*.cc breakpad/src/common/linux/*.cc) + endif() + list(APPEND LIBBREAKPAD_CLIENT_SOURCES ${LIBBREAKPAD_COMMON_SOURCES}) + list(FILTER LIBBREAKPAD_CLIENT_SOURCES EXCLUDE REGEX "/sender|/tests|/unittests|/testcases|_unittest|_test") + target_sources(libbreakpad_client PRIVATE ${LIBBREAKPAD_CLIENT_SOURCES}) + target_include_directories(libbreakpad_client PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/breakpad/src) + + if (WIN32) + target_link_libraries(libbreakpad_client PRIVATE wininet.lib) + elseif (APPLE) + find_library(CoreFoundation_FRAMEWORK CoreFoundation) + target_link_libraries(libbreakpad_client PRIVATE ${CoreFoundation_FRAMEWORK}) + else() + find_library(PTHREAD_LIBRARIES pthread) + target_compile_definitions(libbreakpad_client PRIVATE HAVE_GETCONTEXT=1) + if (PTHREAD_LIBRARIES) + target_link_libraries(libbreakpad_client PRIVATE ${PTHREAD_LIBRARIES}) + endif() + endif() + + # Host tools for symbol processing + if (LINUX) + find_package(ZLIB REQUIRED) + + add_executable(minidump_stackwalk breakpad/src/processor/minidump_stackwalk.cc) + target_link_libraries(minidump_stackwalk PRIVATE libbreakpad libbreakpad_client) + + add_executable(dump_syms + breakpad/src/common/dwarf_cfi_to_module.cc + breakpad/src/common/dwarf_cu_to_module.cc + breakpad/src/common/dwarf_line_to_module.cc + breakpad/src/common/dwarf_range_list_handler.cc + breakpad/src/common/language.cc + breakpad/src/common/module.cc + breakpad/src/common/path_helper.cc + breakpad/src/common/stabs_reader.cc + breakpad/src/common/stabs_to_module.cc + breakpad/src/common/dwarf/bytereader.cc + breakpad/src/common/dwarf/dwarf2diehandler.cc + breakpad/src/common/dwarf/dwarf2reader.cc + breakpad/src/common/dwarf/elf_reader.cc + breakpad/src/common/linux/crc32.cc + breakpad/src/common/linux/dump_symbols.cc + breakpad/src/common/linux/elf_symbols_to_module.cc + breakpad/src/common/linux/elfutils.cc + breakpad/src/common/linux/file_id.cc + breakpad/src/common/linux/linux_libc_support.cc + breakpad/src/common/linux/memory_mapped_file.cc + breakpad/src/common/linux/safe_readlink.cc + breakpad/src/tools/linux/dump_syms/dump_syms.cc) + target_link_libraries(dump_syms PRIVATE libbreakpad_client ZLIB::ZLIB) + endif() +endif() + +# SimpleIni +if (NOT TARGET SimpleIni::SimpleIni) + add_subdirectory(simpleini) +endif() diff --git a/externals/SDL b/externals/SDL -Subproject 031912c4b6c5db80b443f04aa56fec3e4e64515 +Subproject cc016b0046d563287f0aa9f09b958b5e70d4369 diff --git a/externals/Vulkan-Headers b/externals/Vulkan-Headers -Subproject ed857118e243fdc0f3a100f00ac9919e874cfe6 +Subproject df60f0316899460eeaaefa06d2dd7e4e300c160 diff --git a/externals/VulkanMemoryAllocator b/externals/VulkanMemoryAllocator -Subproject 9b0fc3e7b02afe97895eb3e945fe800c3a7485a +Subproject 2f382df218d7e8516dee3b3caccb819a62b571a diff --git a/externals/breakpad b/externals/breakpad new file mode 160000 +Subproject c89f9dddc793f19910ef06c13e4fd240da4e7a5 diff --git a/externals/cpp-httplib b/externals/cpp-httplib -Subproject 6d963fbe8d415399d65e94db7910bbd22fe3741 +Subproject a609330e4c6374f741d3b369269f7848255e195 diff --git a/externals/cpp-jwt b/externals/cpp-jwt -Subproject e12ef06218596b52d9b5d6e1639484866a8e706 +Subproject 10ef5735d842b31025f1257ae78899f50a40fb1 diff --git a/externals/dynarmic b/externals/dynarmic -Subproject 7da378033a7764f955516f75194856d87bbcd7a +Subproject 0df09e2f6b61c2d7ad2f2053d4f020a5c33e037 diff --git a/externals/ffmpeg/ffmpeg b/externals/ffmpeg/ffmpeg -Subproject 6b6b9e593dd4d3aaf75f48d40a13ef03bdef9fd +Subproject 9c1294eaddb88cb0e044c675ccae059a85fc9c6 diff --git a/externals/gamemode/gamemode_client.h b/externals/gamemode/gamemode_client.h new file mode 100644 index 000000000..b9f64fe46 --- /dev/null +++ b/externals/gamemode/gamemode_client.h @@ -0,0 +1,376 @@ +/* + +Copyright (c) 2017-2019, Feral Interactive +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Feral Interactive nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + */ +#ifndef CLIENT_GAMEMODE_H +#define CLIENT_GAMEMODE_H +/* + * GameMode supports the following client functions + * Requests are refcounted in the daemon + * + * int gamemode_request_start() - Request gamemode starts + * 0 if the request was sent successfully + * -1 if the request failed + * + * int gamemode_request_end() - Request gamemode ends + * 0 if the request was sent successfully + * -1 if the request failed + * + * GAMEMODE_AUTO can be defined to make the above two functions apply during static init and + * destruction, as appropriate. In this configuration, errors will be printed to stderr + * + * int gamemode_query_status() - Query the current status of gamemode + * 0 if gamemode is inactive + * 1 if gamemode is active + * 2 if gamemode is active and this client is registered + * -1 if the query failed + * + * int gamemode_request_start_for(pid_t pid) - Request gamemode starts for another process + * 0 if the request was sent successfully + * -1 if the request failed + * -2 if the request was rejected + * + * int gamemode_request_end_for(pid_t pid) - Request gamemode ends for another process + * 0 if the request was sent successfully + * -1 if the request failed + * -2 if the request was rejected + * + * int gamemode_query_status_for(pid_t pid) - Query status of gamemode for another process + * 0 if gamemode is inactive + * 1 if gamemode is active + * 2 if gamemode is active and this client is registered + * -1 if the query failed + * + * const char* gamemode_error_string() - Get an error string + * returns a string describing any of the above errors + * + * Note: All the above requests can be blocking - dbus requests can and will block while the daemon + * handles the request. It is not recommended to make these calls in performance critical code + */ + +#include <stdbool.h> +#include <stdio.h> + +#include <dlfcn.h> +#include <string.h> + +#include <assert.h> + +#include <sys/types.h> + +static char internal_gamemode_client_error_string[512] = { 0 }; + +/** + * Load libgamemode dynamically to dislodge us from most dependencies. + * This allows clients to link and/or use this regardless of runtime. + * See SDL2 for an example of the reasoning behind this in terms of + * dynamic versioning as well. + */ +static volatile int internal_libgamemode_loaded = 1; + +/* Typedefs for the functions to load */ +typedef int (*api_call_return_int)(void); +typedef const char *(*api_call_return_cstring)(void); +typedef int (*api_call_pid_return_int)(pid_t); + +/* Storage for functors */ +static api_call_return_int REAL_internal_gamemode_request_start = NULL; +static api_call_return_int REAL_internal_gamemode_request_end = NULL; +static api_call_return_int REAL_internal_gamemode_query_status = NULL; +static api_call_return_cstring REAL_internal_gamemode_error_string = NULL; +static api_call_pid_return_int REAL_internal_gamemode_request_start_for = NULL; +static api_call_pid_return_int REAL_internal_gamemode_request_end_for = NULL; +static api_call_pid_return_int REAL_internal_gamemode_query_status_for = NULL; + +/** + * Internal helper to perform the symbol binding safely. + * + * Returns 0 on success and -1 on failure + */ +__attribute__((always_inline)) static inline int internal_bind_libgamemode_symbol( + void *handle, const char *name, void **out_func, size_t func_size, bool required) +{ + void *symbol_lookup = NULL; + char *dl_error = NULL; + + /* Safely look up the symbol */ + symbol_lookup = dlsym(handle, name); + dl_error = dlerror(); + if (required && (dl_error || !symbol_lookup)) { + snprintf(internal_gamemode_client_error_string, + sizeof(internal_gamemode_client_error_string), + "dlsym failed - %s", + dl_error); + return -1; + } + + /* Have the symbol correctly, copy it to make it usable */ + memcpy(out_func, &symbol_lookup, func_size); + return 0; +} + +/** + * Loads libgamemode and needed functions + * + * Returns 0 on success and -1 on failure + */ +__attribute__((always_inline)) static inline int internal_load_libgamemode(void) +{ + /* We start at 1, 0 is a success and -1 is a fail */ + if (internal_libgamemode_loaded != 1) { + return internal_libgamemode_loaded; + } + + /* Anonymous struct type to define our bindings */ + struct binding { + const char *name; + void **functor; + size_t func_size; + bool required; + } bindings[] = { + { "real_gamemode_request_start", + (void **)&REAL_internal_gamemode_request_start, + sizeof(REAL_internal_gamemode_request_start), + true }, + { "real_gamemode_request_end", + (void **)&REAL_internal_gamemode_request_end, + sizeof(REAL_internal_gamemode_request_end), + true }, + { "real_gamemode_query_status", + (void **)&REAL_internal_gamemode_query_status, + sizeof(REAL_internal_gamemode_query_status), + false }, + { "real_gamemode_error_string", + (void **)&REAL_internal_gamemode_error_string, + sizeof(REAL_internal_gamemode_error_string), + true }, + { "real_gamemode_request_start_for", + (void **)&REAL_internal_gamemode_request_start_for, + sizeof(REAL_internal_gamemode_request_start_for), + false }, + { "real_gamemode_request_end_for", + (void **)&REAL_internal_gamemode_request_end_for, + sizeof(REAL_internal_gamemode_request_end_for), + false }, + { "real_gamemode_query_status_for", + (void **)&REAL_internal_gamemode_query_status_for, + sizeof(REAL_internal_gamemode_query_status_for), + false }, + }; + + void *libgamemode = NULL; + + /* Try and load libgamemode */ + libgamemode = dlopen("libgamemode.so.0", RTLD_NOW); + if (!libgamemode) { + /* Attempt to load unversioned library for compatibility with older + * versions (as of writing, there are no ABI changes between the two - + * this may need to change if ever ABI-breaking changes are made) */ + libgamemode = dlopen("libgamemode.so", RTLD_NOW); + if (!libgamemode) { + snprintf(internal_gamemode_client_error_string, + sizeof(internal_gamemode_client_error_string), + "dlopen failed - %s", + dlerror()); + internal_libgamemode_loaded = -1; + return -1; + } + } + + /* Attempt to bind all symbols */ + for (size_t i = 0; i < sizeof(bindings) / sizeof(bindings[0]); i++) { + struct binding *binder = &bindings[i]; + + if (internal_bind_libgamemode_symbol(libgamemode, + binder->name, + binder->functor, + binder->func_size, + binder->required)) { + internal_libgamemode_loaded = -1; + return -1; + }; + } + + /* Success */ + internal_libgamemode_loaded = 0; + return 0; +} + +/** + * Redirect to the real libgamemode + */ +__attribute__((always_inline)) static inline const char *gamemode_error_string(void) +{ + /* If we fail to load the system gamemode, or we have an error string already, return our error + * string instead of diverting to the system version */ + if (internal_load_libgamemode() < 0 || internal_gamemode_client_error_string[0] != '\0') { + return internal_gamemode_client_error_string; + } + + /* Assert for static analyser that the function is not NULL */ + assert(REAL_internal_gamemode_error_string != NULL); + + return REAL_internal_gamemode_error_string(); +} + +/** + * Redirect to the real libgamemode + * Allow automatically requesting game mode + * Also prints errors as they happen. + */ +#ifdef GAMEMODE_AUTO +__attribute__((constructor)) +#else +__attribute__((always_inline)) static inline +#endif +int gamemode_request_start(void) +{ + /* Need to load gamemode */ + if (internal_load_libgamemode() < 0) { +#ifdef GAMEMODE_AUTO + fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string()); +#endif + return -1; + } + + /* Assert for static analyser that the function is not NULL */ + assert(REAL_internal_gamemode_request_start != NULL); + + if (REAL_internal_gamemode_request_start() < 0) { +#ifdef GAMEMODE_AUTO + fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string()); +#endif + return -1; + } + + return 0; +} + +/* Redirect to the real libgamemode */ +#ifdef GAMEMODE_AUTO +__attribute__((destructor)) +#else +__attribute__((always_inline)) static inline +#endif +int gamemode_request_end(void) +{ + /* Need to load gamemode */ + if (internal_load_libgamemode() < 0) { +#ifdef GAMEMODE_AUTO + fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string()); +#endif + return -1; + } + + /* Assert for static analyser that the function is not NULL */ + assert(REAL_internal_gamemode_request_end != NULL); + + if (REAL_internal_gamemode_request_end() < 0) { +#ifdef GAMEMODE_AUTO + fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string()); +#endif + return -1; + } + + return 0; +} + +/* Redirect to the real libgamemode */ +__attribute__((always_inline)) static inline int gamemode_query_status(void) +{ + /* Need to load gamemode */ + if (internal_load_libgamemode() < 0) { + return -1; + } + + if (REAL_internal_gamemode_query_status == NULL) { + snprintf(internal_gamemode_client_error_string, + sizeof(internal_gamemode_client_error_string), + "gamemode_query_status missing (older host?)"); + return -1; + } + + return REAL_internal_gamemode_query_status(); +} + +/* Redirect to the real libgamemode */ +__attribute__((always_inline)) static inline int gamemode_request_start_for(pid_t pid) +{ + /* Need to load gamemode */ + if (internal_load_libgamemode() < 0) { + return -1; + } + + if (REAL_internal_gamemode_request_start_for == NULL) { + snprintf(internal_gamemode_client_error_string, + sizeof(internal_gamemode_client_error_string), + "gamemode_request_start_for missing (older host?)"); + return -1; + } + + return REAL_internal_gamemode_request_start_for(pid); +} + +/* Redirect to the real libgamemode */ +__attribute__((always_inline)) static inline int gamemode_request_end_for(pid_t pid) +{ + /* Need to load gamemode */ + if (internal_load_libgamemode() < 0) { + return -1; + } + + if (REAL_internal_gamemode_request_end_for == NULL) { + snprintf(internal_gamemode_client_error_string, + sizeof(internal_gamemode_client_error_string), + "gamemode_request_end_for missing (older host?)"); + return -1; + } + + return REAL_internal_gamemode_request_end_for(pid); +} + +/* Redirect to the real libgamemode */ +__attribute__((always_inline)) static inline int gamemode_query_status_for(pid_t pid) +{ + /* Need to load gamemode */ + if (internal_load_libgamemode() < 0) { + return -1; + } + + if (REAL_internal_gamemode_query_status_for == NULL) { + snprintf(internal_gamemode_client_error_string, + sizeof(internal_gamemode_client_error_string), + "gamemode_query_status_for missing (older host?)"); + return -1; + } + + return REAL_internal_gamemode_query_status_for(pid); +} + +#endif // CLIENT_GAMEMODE_H diff --git a/externals/inih/CMakeLists.txt b/externals/inih/CMakeLists.txt deleted file mode 100644 index ebb60a976..000000000 --- a/externals/inih/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# 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 - inih/cpp/INIReader.cpp - inih/cpp/INIReader.h -) - -create_target_directory_groups(inih) -target_include_directories(inih INTERFACE inih/cpp) -add_library(inih::INIReader ALIAS inih) diff --git a/externals/inih/inih b/externals/inih/inih deleted file mode 160000 -Subproject 1e80a47dffbda813604f0913e2ad68c7054c14e diff --git a/externals/libusb/CMakeLists.txt b/externals/libusb/CMakeLists.txt index 6757b59da..1d50c9f8c 100644 --- a/externals/libusb/CMakeLists.txt +++ b/externals/libusb/CMakeLists.txt @@ -49,11 +49,6 @@ if (MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR APPLE) set(LIBUSB_INCLUDE_DIRS "${LIBUSB_SRC_DIR}/libusb" CACHE PATH "libusb headers path" FORCE) - # MINGW: causes "externals/libusb/libusb/libusb/os/windows_winusb.c:1427:2: error: conversion to non-scalar type requested", so cannot statically link it for now. - if (NOT MINGW) - set(LIBUSB_CFLAGS "-DGUID_DEVINTERFACE_USB_DEVICE=\\(GUID\\){0xA5DCBF10,0x6530,0x11D2,{0x90,0x1F,0x00,0xC0,0x4F,0xB9,0x51,0xED}}") - endif() - make_directory("${LIBUSB_PREFIX}") add_custom_command( @@ -146,8 +141,6 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_include_directories(usb BEFORE PRIVATE libusb/msvc) endif() - # Works around other libraries providing their own definition of USB GUIDs (e.g. SDL2) - target_compile_definitions(usb PRIVATE "-DGUID_DEVINTERFACE_USB_DEVICE=(GUID){ 0xA5DCBF10, 0x6530, 0x11D2, {0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED}}") else() target_include_directories(usb # turns out other projects also have "config.h", so make sure the diff --git a/externals/libusb/libusb b/externals/libusb/libusb -Subproject c6a35c56016ea2ab2f19115d2ea1e85e0edae15 +Subproject c060e9ce30ac2e3ffb49d94209c4dae77b6642f diff --git a/externals/nx_tzdb/tzdb_to_nx b/externals/nx_tzdb/tzdb_to_nx -Subproject 0d17dd066d91f954a4c89d46dcb067eead6b1e4 +Subproject f6680093bca30265c161581fd813d4ddd33f1e3 diff --git a/externals/oaknut b/externals/oaknut new file mode 160000 +Subproject 918bd94f025d6a2de13978468351598997ae390 diff --git a/externals/opus b/externals/opus new file mode 160000 +Subproject 101a71e03bbf860aaafb7090a0e440675cb2766 diff --git a/externals/opus/CMakeLists.txt b/externals/opus/CMakeLists.txt deleted file mode 100644 index d9a03423d..000000000 --- a/externals/opus/CMakeLists.txt +++ /dev/null @@ -1,259 +0,0 @@ -# SPDX-FileCopyrightText: 2019 yuzu Emulator Project -# SPDX-License-Identifier: GPL-2.0-or-later - -cmake_minimum_required(VERSION 3.8) - -project(opus) - -option(OPUS_STACK_PROTECTOR "Use stack protection" OFF) -option(OPUS_USE_ALLOCA "Use alloca for stack arrays (on non-C99 compilers)" OFF) -option(OPUS_CUSTOM_MODES "Enable non-Opus modes, e.g. 44.1 kHz & 2^n frames" OFF) -option(OPUS_FIXED_POINT "Compile as fixed-point (for machines without a fast enough FPU)" OFF) -option(OPUS_ENABLE_FLOAT_API "Compile with the floating point API (for machines with float library" ON) - -include(opus/opus_functions.cmake) - -if(OPUS_STACK_PROTECTOR) - if(NOT MSVC) # GC on by default on MSVC - check_and_set_flag(STACK_PROTECTION_STRONG -fstack-protector-strong) - endif() -else() - if(MSVC) - check_and_set_flag(BUFFER_SECURITY_CHECK /GS-) - endif() -endif() - -add_library(opus - # CELT sources - opus/celt/bands.c - opus/celt/celt.c - opus/celt/celt_decoder.c - opus/celt/celt_encoder.c - opus/celt/celt_lpc.c - opus/celt/cwrs.c - opus/celt/entcode.c - opus/celt/entdec.c - opus/celt/entenc.c - opus/celt/kiss_fft.c - opus/celt/laplace.c - opus/celt/mathops.c - opus/celt/mdct.c - opus/celt/modes.c - opus/celt/pitch.c - opus/celt/quant_bands.c - opus/celt/rate.c - opus/celt/vq.c - - # SILK sources - opus/silk/A2NLSF.c - opus/silk/CNG.c - opus/silk/HP_variable_cutoff.c - opus/silk/LPC_analysis_filter.c - opus/silk/LPC_fit.c - opus/silk/LPC_inv_pred_gain.c - opus/silk/LP_variable_cutoff.c - opus/silk/NLSF2A.c - opus/silk/NLSF_VQ.c - opus/silk/NLSF_VQ_weights_laroia.c - opus/silk/NLSF_decode.c - opus/silk/NLSF_del_dec_quant.c - opus/silk/NLSF_encode.c - opus/silk/NLSF_stabilize.c - opus/silk/NLSF_unpack.c - opus/silk/NSQ.c - opus/silk/NSQ_del_dec.c - opus/silk/PLC.c - opus/silk/VAD.c - opus/silk/VQ_WMat_EC.c - opus/silk/ana_filt_bank_1.c - opus/silk/biquad_alt.c - opus/silk/bwexpander.c - opus/silk/bwexpander_32.c - opus/silk/check_control_input.c - opus/silk/code_signs.c - opus/silk/control_SNR.c - opus/silk/control_audio_bandwidth.c - opus/silk/control_codec.c - opus/silk/dec_API.c - opus/silk/decode_core.c - opus/silk/decode_frame.c - opus/silk/decode_indices.c - opus/silk/decode_parameters.c - opus/silk/decode_pitch.c - opus/silk/decode_pulses.c - opus/silk/decoder_set_fs.c - opus/silk/enc_API.c - opus/silk/encode_indices.c - opus/silk/encode_pulses.c - opus/silk/gain_quant.c - opus/silk/init_decoder.c - opus/silk/init_encoder.c - opus/silk/inner_prod_aligned.c - opus/silk/interpolate.c - opus/silk/lin2log.c - opus/silk/log2lin.c - opus/silk/pitch_est_tables.c - opus/silk/process_NLSFs.c - opus/silk/quant_LTP_gains.c - opus/silk/resampler.c - opus/silk/resampler_down2.c - opus/silk/resampler_down2_3.c - opus/silk/resampler_private_AR2.c - opus/silk/resampler_private_IIR_FIR.c - opus/silk/resampler_private_down_FIR.c - opus/silk/resampler_private_up2_HQ.c - opus/silk/resampler_rom.c - opus/silk/shell_coder.c - opus/silk/sigm_Q15.c - opus/silk/sort.c - opus/silk/stereo_LR_to_MS.c - opus/silk/stereo_MS_to_LR.c - opus/silk/stereo_decode_pred.c - opus/silk/stereo_encode_pred.c - opus/silk/stereo_find_predictor.c - opus/silk/stereo_quant_pred.c - opus/silk/sum_sqr_shift.c - opus/silk/table_LSF_cos.c - opus/silk/tables_LTP.c - opus/silk/tables_NLSF_CB_NB_MB.c - opus/silk/tables_NLSF_CB_WB.c - opus/silk/tables_gain.c - opus/silk/tables_other.c - opus/silk/tables_pitch_lag.c - opus/silk/tables_pulses_per_block.c - - # Opus sources - opus/src/analysis.c - opus/src/mapping_matrix.c - opus/src/mlp.c - opus/src/mlp_data.c - opus/src/opus.c - opus/src/opus_decoder.c - opus/src/opus_encoder.c - opus/src/opus_multistream.c - opus/src/opus_multistream_decoder.c - opus/src/opus_multistream_encoder.c - opus/src/opus_projection_decoder.c - opus/src/opus_projection_encoder.c - opus/src/repacketizer.c -) - -if (DEBUG) - target_sources(opus PRIVATE opus/silk/debug.c) -endif() - -if (OPUS_FIXED_POINT) - target_sources(opus PRIVATE - opus/silk/fixed/LTP_analysis_filter_FIX.c - opus/silk/fixed/LTP_scale_ctrl_FIX.c - opus/silk/fixed/apply_sine_window_FIX.c - opus/silk/fixed/autocorr_FIX.c - opus/silk/fixed/burg_modified_FIX.c - opus/silk/fixed/corrMatrix_FIX.c - opus/silk/fixed/encode_frame_FIX.c - opus/silk/fixed/find_LPC_FIX.c - opus/silk/fixed/find_LTP_FIX.c - opus/silk/fixed/find_pitch_lags_FIX.c - opus/silk/fixed/find_pred_coefs_FIX.c - opus/silk/fixed/k2a_FIX.c - opus/silk/fixed/k2a_Q16_FIX.c - opus/silk/fixed/noise_shape_analysis_FIX.c - opus/silk/fixed/pitch_analysis_core_FIX.c - opus/silk/fixed/prefilter_FIX.c - opus/silk/fixed/process_gains_FIX.c - opus/silk/fixed/regularize_correlations_FIX.c - opus/silk/fixed/residual_energy16_FIX.c - opus/silk/fixed/residual_energy_FIX.c - opus/silk/fixed/schur64_FIX.c - opus/silk/fixed/schur_FIX.c - opus/silk/fixed/solve_LS_FIX.c - opus/silk/fixed/vector_ops_FIX.c - opus/silk/fixed/warped_autocorrelation_FIX.c - ) -else() - target_sources(opus PRIVATE - opus/silk/float/LPC_analysis_filter_FLP.c - opus/silk/float/LPC_inv_pred_gain_FLP.c - opus/silk/float/LTP_analysis_filter_FLP.c - opus/silk/float/LTP_scale_ctrl_FLP.c - opus/silk/float/apply_sine_window_FLP.c - opus/silk/float/autocorrelation_FLP.c - opus/silk/float/burg_modified_FLP.c - opus/silk/float/bwexpander_FLP.c - opus/silk/float/corrMatrix_FLP.c - opus/silk/float/encode_frame_FLP.c - opus/silk/float/energy_FLP.c - opus/silk/float/find_LPC_FLP.c - opus/silk/float/find_LTP_FLP.c - opus/silk/float/find_pitch_lags_FLP.c - opus/silk/float/find_pred_coefs_FLP.c - opus/silk/float/inner_product_FLP.c - opus/silk/float/k2a_FLP.c - opus/silk/float/noise_shape_analysis_FLP.c - opus/silk/float/pitch_analysis_core_FLP.c - opus/silk/float/process_gains_FLP.c - opus/silk/float/regularize_correlations_FLP.c - opus/silk/float/residual_energy_FLP.c - opus/silk/float/scale_copy_vector_FLP.c - opus/silk/float/scale_vector_FLP.c - opus/silk/float/schur_FLP.c - opus/silk/float/sort_FLP.c - opus/silk/float/warped_autocorrelation_FLP.c - opus/silk/float/wrappers_FLP.c - ) -endif() - -target_compile_definitions(opus PRIVATE OPUS_BUILD ENABLE_HARDENING) - -if(NOT MSVC) - if(MINGW) - target_compile_definitions(opus PRIVATE _FORTIFY_SOURCE=0) - else() - target_compile_definitions(opus PRIVATE _FORTIFY_SOURCE=2) - endif() -endif() - -# It is strongly recommended to uncomment one of these VAR_ARRAYS: Use C99 -# variable-length arrays for stack allocation USE_ALLOCA: Use alloca() for stack -# allocation If none is defined, then the fallback is a non-threadsafe global -# array -if(OPUS_USE_ALLOCA OR MSVC) - target_compile_definitions(opus PRIVATE USE_ALLOCA) -else() - target_compile_definitions(opus PRIVATE VAR_ARRAYS) -endif() - -if(OPUS_CUSTOM_MODES) - target_compile_definitions(opus PRIVATE CUSTOM_MODES) -endif() - -if(NOT OPUS_ENABLE_FLOAT_API) - target_compile_definitions(opus PRIVATE DISABLE_FLOAT_API) -endif() - -target_compile_definitions(opus -PUBLIC - -DOPUS_VERSION="\\"1.3.1\\"" - -PRIVATE - # Use C99 intrinsics to speed up float-to-int conversion - HAVE_LRINTF -) - -if (FIXED_POINT) - target_compile_definitions(opus PRIVATE -DFIXED_POINT=1 -DDISABLE_FLOAT_API) -endif() - -target_include_directories(opus -PUBLIC - opus/include - -PRIVATE - opus/celt - opus/silk - opus/silk/fixed - opus/silk/float - opus/src -) - -add_library(Opus::opus ALIAS opus) diff --git a/externals/opus/opus b/externals/opus/opus deleted file mode 160000 -Subproject ad8fe90db79b7d2a135e3dfd2ed6631b0c5662a diff --git a/externals/simpleini b/externals/simpleini new file mode 160000 +Subproject 382ddbb4b92c0b26aa1b32cefba2002119a5b1f diff --git a/externals/vcpkg b/externals/vcpkg -Subproject cbf56573a987527b39272e88cbdd11389b78c6e +Subproject ef2eef17340f3fbd679327d286fad06dd6e838e |