Skip to content

Commit

Permalink
Merge pull request #16 from project-slippi/upstream-merge-2024-02-09
Browse files Browse the repository at this point in the history
chore: upstream merge to 5.0-21088
  • Loading branch information
NikhilNarayana authored Feb 15, 2024
2 parents 667102f + ad8061b commit bdd9005
Show file tree
Hide file tree
Showing 2,187 changed files with 255,780 additions and 291,261 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
name: Verify SlippiRustExtensions Commit is in Main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Main Branch Check
shell: bash
run: |
Expand All @@ -59,7 +59,7 @@ jobs:
runs-on: windows-2022
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- id: rust_ver
Expand All @@ -72,7 +72,7 @@ jobs:
toolchain: ${{ steps.rust_ver.outputs.rust_ver }} # Pin to our specific Rust version.
rustflags: "" # Disable default injection of warnings = errors.
- name: Cache Utils
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
./CodeSignTool/
Expand Down Expand Up @@ -117,9 +117,9 @@ jobs:
echo "not release, skipping code signing"
exit 0;
}
mkdir CodeSignTool
cd .\CodeSignTool
if (!(Test-Path ".\CodeSignTool\CodeSignTool.bat" -PathType Leaf)) {
if (!(Test-Path ".\CodeSignTool\CodeSignTool.bat" -PathType Leaf)) {
mkdir CodeSignTool
cd .\CodeSignTool
Invoke-WebRequest -Uri https://www.ssl.com/download/codesigntool-for-windows/ -UseBasicParsing -OutFile ".\CodeSignTool.zip"
7z x CodeSignTool.zip
Remove-Item CodeSignTool.zip
Expand All @@ -136,7 +136,7 @@ jobs:
7z a $FILE_NAME .\*
move $FILE_NAME ..\..\artifact\
- name: "Publish"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: "./artifact/"
Expand All @@ -158,7 +158,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- id: rust_ver
Expand Down Expand Up @@ -216,6 +216,7 @@ jobs:
libegl1-mesa-dev \
libpng-dev \
qt6-base-private-dev \
libqt6svg6-dev \
libxxf86vm-dev \
x11proto-xinerama-dev \
libfuse2
Expand All @@ -240,7 +241,7 @@ jobs:
popd
mv "${FILE_NAME}" ./artifact/
- name: "Publish"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: "./artifact/"
Expand All @@ -262,7 +263,7 @@ jobs:
runs-on: macos-12
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- id: rust_ver
Expand Down Expand Up @@ -349,7 +350,7 @@ jobs:
/usr/bin/codesign -f -s "${{ secrets.APPLE_IDENTITY_HASH }}" --deep --options runtime ./artifact/${{ env.FILE_NAME }}.dmg
chmod +x Tools/notarize_netplay.sh && ./Tools/notarize_netplay.sh ./artifact/${{ env.FILE_NAME }}.dmg
- name: "Publish"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: "./artifact/"
Expand Down
24 changes: 24 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,27 @@
[submodule "Externals/SlippiRustExtensions"]
path = Externals/SlippiRustExtensions
url = https://github.com/project-slippi/slippi-rust-extensions.git
[submodule "Externals/rcheevos/rcheevos"]
path = Externals/rcheevos/rcheevos
url = https://github.com/RetroAchievements/rcheevos.git
[submodule "Externals/libadrenotools"]
path = Externals/libadrenotools
url = https://github.com/bylaws/libadrenotools.git
[submodule "Externals/curl/curl"]
path = Externals/curl/curl
url = https://github.com/curl/curl.git
[submodule "Externals/fmt/fmt"]
path = Externals/fmt/fmt
url = https://github.com/fmtlib/fmt.git
[submodule "Externals/lz4/lz4"]
path = Externals/lz4/lz4
url = https://github.com/lz4/lz4
[submodule "Externals/xxhash/xxHash"]
path = Externals/xxhash/xxHash
url = https://github.com/Cyan4973/xxHash.git
[submodule "Externals/enet/enet"]
path = Externals/enet/enet
url = https://github.com/lsalzman/enet.git
[submodule "hidapi-src"]
path = Externals/hidapi/hidapi-src
url = https://github.com/libusb/hidapi
11 changes: 10 additions & 1 deletion BuildMacOSUniversalBinary.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@
"steam": False,

# Whether our autoupdate functionality is enabled or not.
"autoupdate": True
"autoupdate": True,

# The distributor for this build.
"distributor": "None"
}

# Architectures to build for. This is explicity left out of the command line
Expand Down Expand Up @@ -136,6 +139,11 @@ def parse_args(conf=DEFAULT_CONFIG):
action=argparse.BooleanOptionalAction,
default=conf["autoupdate"])

parser.add_argument(
"--distributor",
help="Sets the distributor for this build",
default=conf["distributor"])

parser.add_argument(
"--codesign",
help="Code signing identity to use to sign the applications",
Expand Down Expand Up @@ -316,6 +324,7 @@ def build(config):
+ python_to_cmake_bool(config["steam"]),
"-DENABLE_AUTOUPDATE="
+ python_to_cmake_bool(config["autoupdate"]),
'-DDISTRIBUTOR=' + config['distributor']
],
env=env, cwd=arch)

Expand Down
2 changes: 2 additions & 0 deletions CMake/CheckAndAddFlag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function(check_and_add_flag var flag)
set(genexp_config_test "1")
if(ARGV2 STREQUAL "DEBUG_ONLY")
set(genexp_config_test "$<CONFIG:Debug>")
elseif(ARGV2 STREQUAL "NO_DEBINFO_ONLY")
set(genexp_config_test "$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>>")
elseif(ARGV2 STREQUAL "RELEASE_ONLY")
set(genexp_config_test "$<NOT:$<CONFIG:Debug>>")
elseif(ARGV2)
Expand Down
29 changes: 0 additions & 29 deletions CMake/CheckVendoringApproved.cmake

This file was deleted.

75 changes: 75 additions & 0 deletions CMake/DolphinLibraryTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,78 @@ function(dolphin_make_imported_target_if_missing target lib)
add_library(${target} ALIAS _${lib})
endif()
endfunction()

function(dolphin_optional_system_library library)
string(TOUPPER ${library} upperlib)
set(USE_SYSTEM_${upperlib} "" CACHE STRING "Use system ${library} instead of bundled. ON - Always use system and fail if unavailable, OFF - Always use bundled, AUTO - Use system if available, otherwise use bundled, blank - Delegate to USE_SYSTEM_LIBS. Default is blank.")
if("${USE_SYSTEM_${upperlib}}" STREQUAL "")
if(APPROVED_VENDORED_DEPENDENCIES)
string(TOLOWER ${library} lowerlib)
if(lowerlib IN_LIST APPROVED_VENDORED_DEPENDENCIES)
set(RESOLVED_USE_SYSTEM_${upperlib} AUTO PARENT_SCOPE)
else()
set(RESOLVED_USE_SYSTEM_${upperlib} ON PARENT_SCOPE)
endif()
else()
set(RESOLVED_USE_SYSTEM_${upperlib} ${USE_SYSTEM_LIBS} PARENT_SCOPE)
endif()
else()
set(RESOLVED_USE_SYSTEM_${upperlib} ${USE_SYSTEM_${upperlib}} PARENT_SCOPE)
endif()
endfunction()

function(dolphin_add_bundled_library library bundled_path)
string(TOUPPER ${library} upperlib)
if (${RESOLVED_USE_SYSTEM_${upperlib}} STREQUAL "AUTO")
message(STATUS "No system ${library} was found. Using static ${library} from Externals.")
else()
message(STATUS "Using static ${library} from Externals")
endif()
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${bundled_path}/CMakeLists.txt")
message(FATAL_ERROR "No bundled ${library} was found. Did you forget to checkout submodules?")
endif()
add_subdirectory(${bundled_path} EXCLUDE_FROM_ALL)
endfunction()

function(dolphin_find_optional_system_library library bundled_path)
dolphin_optional_system_library(${library})
string(TOUPPER ${library} upperlib)
if(RESOLVED_USE_SYSTEM_${upperlib})
find_package(${library} ${ARGN})
# Yay for cmake packages being inconsistent
if(DEFINED ${library}_FOUND)
set(prefix ${library})
else()
set(prefix ${upperlib})
endif()
if((NOT ${found}) AND (NOT ${RESOLVED_USE_SYSTEM_${upperlib}} STREQUAL "AUTO"))
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
endif()
endif()
if(${prefix}_FOUND)
message(STATUS "Using system ${library}")
set(${prefix}_TYPE "System" PARENT_SCOPE)
else()
dolphin_add_bundled_library(${library} ${bundled_path})
set(${prefix}_TYPE "Bundled" PARENT_SCOPE)
endif()
endfunction()

function(dolphin_find_optional_system_library_pkgconfig library search alias bundled_path)
dolphin_optional_system_library(${library})
string(TOUPPER ${library} upperlib)
if(RESOLVED_USE_SYSTEM_${upperlib})
pkg_check_modules(${library} ${search} ${ARGN} IMPORTED_TARGET)
if((NOT ${library}_FOUND) AND (NOT ${RESOLVED_USE_SYSTEM_${upperlib}} STREQUAL "AUTO"))
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
endif()
endif()
if(${library}_FOUND)
message(STATUS "Using system ${library}")
dolphin_alias_library(${alias} PkgConfig::${library})
set(${library}_TYPE "System" PARENT_SCOPE)
else()
dolphin_add_bundled_library(${library} ${bundled_path})
set(${library}_TYPE "Bundled" PARENT_SCOPE)
endif()
endfunction()
2 changes: 1 addition & 1 deletion CMake/FindCUBEB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CUBEB DEFAULT_MSG
CUBEB_INCLUDE_DIR CUBEB_LIBRARY)

if(CUBEB_FOUND AND NOT TARGET CUBEB)
if(CUBEB_FOUND AND NOT TARGET cubeb::cubeb)
add_library(cubeb::cubeb UNKNOWN IMPORTED)
set_target_properties(cubeb::cubeb PROPERTIES
IMPORTED_LOCATION "${CUBEB_LIBRARY}"
Expand Down
101 changes: 101 additions & 0 deletions CMake/FindIconv.cmake
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()
15 changes: 15 additions & 0 deletions CMake/FindLZO.cmake
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()
Loading

0 comments on commit bdd9005

Please sign in to comment.