mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-14 12:56:09 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb07a431b8 | |||
| 3ae3e1fdfc | |||
| 87e65c5192 | |||
| 95401eeed5 | |||
| 05f14b897c | |||
| a6423a88cc | |||
| f87b1dafc8 | |||
| 707e8afb29 | |||
| bf115ef5a7 | |||
| b154a7da3c | |||
| 37026c8aaa | |||
| 65beea7c73 |
@@ -1,116 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
case "$1" in
|
||||
amd64 | "")
|
||||
echo "Making amd64-v3 optimized build of Eden"
|
||||
ARCH="amd64_v3"
|
||||
ARCH_FLAGS="-march=x86-64-v3"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=v3)
|
||||
;;
|
||||
steamdeck | zen2)
|
||||
echo "Making Steam Deck (Zen 2) optimized build of Eden"
|
||||
ARCH="steamdeck"
|
||||
ARCH_FLAGS="-march=znver2 -mtune=znver2"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=zen2 -DYUZU_SYSTEM_PROFILE=steamdeck)
|
||||
;;
|
||||
rog-ally | allyx | zen4)
|
||||
echo "Making ROG Ally X (Zen 4) optimized build of Eden"
|
||||
ARCH="rog-ally-x"
|
||||
ARCH_FLAGS="-march=znver4 -mtune=znver4"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=zen2 -DYUZU_SYSTEM_PROFILE=steamdeck)
|
||||
;;
|
||||
legacy)
|
||||
echo "Making amd64 generic build of Eden"
|
||||
ARCH=amd64
|
||||
ARCH_FLAGS="-march=x86-64 -mtune=generic"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=generic)
|
||||
;;
|
||||
aarch64)
|
||||
echo "Making armv8-a build of Eden"
|
||||
ARCH=aarch64
|
||||
ARCH_FLAGS="-march=armv8-a -mtune=generic -w"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=generic)
|
||||
;;
|
||||
armv9)
|
||||
echo "Making armv9-a build of Eden"
|
||||
ARCH=armv9
|
||||
ARCH_FLAGS="-march=armv9-a -mtune=generic -w"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=armv9)
|
||||
;;
|
||||
native)
|
||||
echo "Making native build of Eden"
|
||||
ARCH="$(uname -m)"
|
||||
ARCH_FLAGS="-march=native -mtune=native"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=native)
|
||||
;;
|
||||
*)
|
||||
echo "Invalid target $1 specified, must be one of native, amd64, steamdeck, zen2, allyx, rog-ally, zen4, legacy, aarch64, armv9"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
export ARCH_FLAGS="$ARCH_FLAGS -O3"
|
||||
|
||||
if [ -z "$NPROC" ]; then
|
||||
NPROC="$(nproc)"
|
||||
fi
|
||||
|
||||
if [ "$1" != "" ]; then shift; fi
|
||||
|
||||
if [ "$TARGET" = "appimage" ]; then
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DCMAKE_INSTALL_PREFIX=/usr -DYUZU_ROOM=ON -DYUZU_ROOM_STANDALONE=OFF -DYUZU_CMD=OFF)
|
||||
else
|
||||
# For the linux-fresh verification target, verify compilation without PCH as well.
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DYUZU_USE_PRECOMPILED_HEADERS=OFF)
|
||||
fi
|
||||
|
||||
|
||||
if [ "$DEVEL" != "true" ]; then
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DENABLE_UPDATE_CHECKER=ON)
|
||||
fi
|
||||
|
||||
if [ "$USE_WEBENGINE" = "true" ]; then
|
||||
WEBENGINE=ON
|
||||
else
|
||||
WEBENGINE=OFF
|
||||
fi
|
||||
|
||||
if [ "$USE_MULTIMEDIA" = "false" ]; then
|
||||
MULTIMEDIA=OFF
|
||||
else
|
||||
MULTIMEDIA=ON
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_TYPE" ]; then
|
||||
export BUILD_TYPE="Release"
|
||||
fi
|
||||
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@)
|
||||
|
||||
mkdir -p build && cd build
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
-DCMAKE_CXX_FLAGS="$ARCH_FLAGS" \
|
||||
-DCMAKE_C_FLAGS="$ARCH_FLAGS" \
|
||||
-DYUZU_USE_BUNDLED_QT=OFF \
|
||||
-DYUZU_USE_BUNDLED_SDL2=OFF \
|
||||
-DYUZU_USE_EXTERNAL_SDL2=ON \
|
||||
-DYUZU_TESTS=OFF \
|
||||
-DYUZU_USE_QT_MULTIMEDIA=$MULTIMEDIA \
|
||||
-DYUZU_USE_QT_WEB_ENGINE=$WEBENGINE \
|
||||
-DYUZU_USE_FASTER_LD=ON \
|
||||
-DENABLE_LTO=ON \
|
||||
"${EXTRA_CMAKE_FLAGS[@]}"
|
||||
|
||||
ninja -j${NPROC}
|
||||
|
||||
if [ -d "bin/Release" ]; then
|
||||
strip -s bin/Release/*
|
||||
else
|
||||
strip -s bin/*
|
||||
fi
|
||||
@@ -1,250 +0,0 @@
|
||||
AppRun
|
||||
eden.desktop
|
||||
dev.eden_emu.eden.desktop
|
||||
shared/bin/eden
|
||||
shared/lib/lib.path
|
||||
shared/lib/ld-linux-x86-64.so.2
|
||||
shared/lib/libQt6Widgets.so.6.4.2
|
||||
shared/lib/libQt6DBus.so.6.4.2
|
||||
shared/lib/libudev.so.1.7.5
|
||||
shared/lib/libbrotlienc.so.1.0.9
|
||||
shared/lib/libbrotlidec.so.1.0.9
|
||||
shared/lib/libssl.so.3
|
||||
shared/lib/libcrypto.so.3
|
||||
shared/lib/libavcodec.so.59.37.100
|
||||
shared/lib/libavutil.so.57.28.100
|
||||
shared/lib/libQt6Gui.so.6.4.2
|
||||
shared/lib/libQt6Core.so.6.4.2
|
||||
shared/lib/libstdc++.so.6.0.30
|
||||
shared/lib/libm.so.6
|
||||
shared/lib/libgcc_s.so.1
|
||||
shared/lib/libc.so.6
|
||||
shared/lib/libdbus-1.so.3.32.4
|
||||
shared/lib/libbrotlicommon.so.1.0.9
|
||||
shared/lib/libswresample.so.4.7.100
|
||||
shared/lib/libvpx.so.7.1.0
|
||||
shared/lib/libwebpmux.so.3.0.10
|
||||
shared/lib/libwebp.so.7.1.5
|
||||
shared/lib/liblzma.so.5.4.1
|
||||
shared/lib/libdav1d.so.6.6.0
|
||||
shared/lib/librsvg-2.so.2.48.0
|
||||
shared/lib/libgobject-2.0.so.0.7400.6
|
||||
shared/lib/libglib-2.0.so.0.7400.6
|
||||
shared/lib/libcairo.so.2.11600.0
|
||||
shared/lib/libzvbi.so.0.13.2
|
||||
shared/lib/libz.so.1.2.13
|
||||
shared/lib/libsnappy.so.1.1.9
|
||||
shared/lib/libaom.so.3.6.0
|
||||
shared/lib/libcodec2.so.1.0
|
||||
shared/lib/libgsm.so.1.0.19
|
||||
shared/lib/libjxl.so.0.7.0
|
||||
shared/lib/libjxl_threads.so.0.7.0
|
||||
shared/lib/libmp3lame.so.0.0.0
|
||||
shared/lib/libopenjp2.so.2.5.0
|
||||
shared/lib/libopus.so.0.8.0
|
||||
shared/lib/librav1e.so.0.5.1
|
||||
shared/lib/libshine.so.3.0.1
|
||||
shared/lib/libspeex.so.1.5.2
|
||||
shared/lib/libSvtAv1Enc.so.1.4.1
|
||||
shared/lib/libtheoraenc.so.1.1.2
|
||||
shared/lib/libtheoradec.so.1.1.4
|
||||
shared/lib/libtwolame.so.0.0.0
|
||||
shared/lib/libvorbis.so.0.4.9
|
||||
shared/lib/libvorbisenc.so.2.0.12
|
||||
shared/lib/libx264.so.164
|
||||
shared/lib/libx265.so.199
|
||||
shared/lib/libxvidcore.so.4.3
|
||||
shared/lib/libva.so.2.1700.0
|
||||
shared/lib/libmfx.so.1.35
|
||||
shared/lib/libva-drm.so.2.1700.0
|
||||
shared/lib/libva-x11.so.2.1700.0
|
||||
shared/lib/libvdpau.so.1.0.0
|
||||
shared/lib/libX11.so.6.4.0
|
||||
shared/lib/libdrm.so.2.4.0
|
||||
shared/lib/libOpenCL.so.1.0.0
|
||||
shared/lib/libEGL.so.1.1.0
|
||||
shared/lib/libfontconfig.so.1.12.0
|
||||
shared/lib/libxkbcommon.so.0.0.0
|
||||
shared/lib/libGLX.so.0.0.0
|
||||
shared/lib/libOpenGL.so.0.0.0
|
||||
shared/lib/libpng16.so.16.39.0
|
||||
shared/lib/libharfbuzz.so.0.60000.0
|
||||
shared/lib/libmd4c.so.0.4.8
|
||||
shared/lib/libfreetype.so.6.18.3
|
||||
shared/lib/libicui18n.so.72.1
|
||||
shared/lib/libicuuc.so.72.1
|
||||
shared/lib/libdouble-conversion.so.3.1
|
||||
shared/lib/libb2.so.1.0.4
|
||||
shared/lib/libpcre2-16.so.0.11.2
|
||||
shared/lib/libzstd.so.1.5.4
|
||||
shared/lib/libsystemd.so.0.35.0
|
||||
shared/lib/libsoxr.so.0.1.2
|
||||
shared/lib/libcairo-gobject.so.2.11600.0
|
||||
shared/lib/libgdk_pixbuf-2.0.so.0.4200.10
|
||||
shared/lib/libgio-2.0.so.0.7400.6
|
||||
shared/lib/libxml2.so.2.9.14
|
||||
shared/lib/libpangocairo-1.0.so.0.5000.12
|
||||
shared/lib/libpango-1.0.so.0.5000.12
|
||||
shared/lib/libffi.so.8.1.2
|
||||
shared/lib/libpcre2-8.so.0.11.2
|
||||
shared/lib/libpixman-1.so.0.42.2
|
||||
shared/lib/libxcb-shm.so.0.0.0
|
||||
shared/lib/libxcb.so.1.1.0
|
||||
shared/lib/libxcb-render.so.0.0.0
|
||||
shared/lib/libXrender.so.1.3.0
|
||||
shared/lib/libXext.so.6.4.0
|
||||
shared/lib/libhwy.so.1.0.3
|
||||
shared/lib/liblcms2.so.2.0.14
|
||||
shared/lib/libogg.so.0.8.5
|
||||
shared/lib/libnuma.so.1.0.0
|
||||
shared/lib/libpthread.so.0
|
||||
shared/lib/libXfixes.so.3.1.0
|
||||
shared/lib/libX11-xcb.so.1.0.0
|
||||
shared/lib/libxcb-dri3.so.0.1.0
|
||||
shared/lib/libGLdispatch.so.0.0.0
|
||||
shared/lib/libexpat.so.1.8.10
|
||||
shared/lib/libgraphite2.so.3.2.1
|
||||
shared/lib/libicudata.so.72.1
|
||||
shared/lib/libgomp.so.1.0.0
|
||||
shared/lib/libcap.so.2.66
|
||||
shared/lib/libgcrypt.so.20.4.1
|
||||
shared/lib/liblz4.so.1.9.4
|
||||
shared/lib/libgmodule-2.0.so.0.7400.6
|
||||
shared/lib/libjpeg.so.62.3.0
|
||||
shared/lib/libmount.so.1.1.0
|
||||
shared/lib/libselinux.so.1
|
||||
shared/lib/libpangoft2-1.0.so.0.5000.12
|
||||
shared/lib/libfribidi.so.0.4.0
|
||||
shared/lib/libthai.so.0.3.1
|
||||
shared/lib/libXau.so.6.0.0
|
||||
shared/lib/libXdmcp.so.6.0.0
|
||||
shared/lib/libgpg-error.so.0.33.1
|
||||
shared/lib/libblkid.so.1.1.0
|
||||
shared/lib/libdatrie.so.1.4.0
|
||||
shared/lib/libbsd.so.0.11.7
|
||||
shared/lib/libmd.so.0.0.5
|
||||
shared/lib/libvulkan.so.1.3.239
|
||||
share/vulkan/icd.d/intel_hasvk_icd.x86_64.json
|
||||
shared/lib/libvulkan_intel_hasvk.so
|
||||
shared/lib/libwayland-client.so.0.21.0
|
||||
shared/lib/libxcb-present.so.0.0.0
|
||||
shared/lib/libxcb-xfixes.so.0.0.0
|
||||
shared/lib/libxcb-sync.so.1.0.0
|
||||
shared/lib/libxcb-randr.so.0.1.0
|
||||
shared/lib/libxshmfence.so.1.0.0
|
||||
share/vulkan/icd.d/intel_icd.x86_64.json
|
||||
shared/lib/libvulkan_intel.so
|
||||
share/vulkan/icd.d/lvp_icd.x86_64.json
|
||||
shared/lib/libvulkan_lvp.so
|
||||
shared/lib/libLLVM-15.so.1
|
||||
shared/lib/libedit.so.2.0.70
|
||||
shared/lib/libz3.so.4
|
||||
shared/lib/libtinfo.so.6.4
|
||||
share/vulkan/icd.d/radeon_icd.x86_64.json
|
||||
shared/lib/libvulkan_radeon.so
|
||||
shared/lib/libdrm_amdgpu.so.1.0.0
|
||||
shared/lib/libelf-0.188.so
|
||||
shared/lib/libVkLayer_MESA_device_select.so
|
||||
bin/qt.conf
|
||||
shared/lib/qt6/plugins/platforms/libqeglfs.so
|
||||
shared/lib/qt6/plugins/platforms/libqlinuxfb.so
|
||||
shared/lib/qt6/plugins/platforms/libqminimal.so
|
||||
shared/lib/qt6/plugins/platforms/libqminimalegl.so
|
||||
shared/lib/qt6/plugins/platforms/libqoffscreen.so
|
||||
shared/lib/qt6/plugins/platforms/libqvkkhrdisplay.so
|
||||
shared/lib/qt6/plugins/platforms/libqvnc.so
|
||||
shared/lib/qt6/plugins/platforms/libqwayland-egl.so
|
||||
shared/lib/qt6/plugins/platforms/libqwayland-generic.so
|
||||
shared/lib/qt6/plugins/platforms/libqxcb.so
|
||||
shared/lib/libQt6WaylandClient.so.6.4.2
|
||||
shared/lib/libwayland-cursor.so.0.21.0
|
||||
shared/lib/qt6/plugins/platformthemes/libqgtk3.so
|
||||
shared/lib/libgtk-3.so.0.2406.32
|
||||
shared/lib/libgdk-3.so.0.2406.32
|
||||
shared/lib/libatk-1.0.so.0.24609.1
|
||||
shared/lib/libepoxy.so.0.0.0
|
||||
shared/lib/libXi.so.6.1.0
|
||||
shared/lib/libatk-bridge-2.0.so.0.0.0
|
||||
shared/lib/libwayland-egl.so.1.21.0
|
||||
shared/lib/libXcursor.so.1.0.2
|
||||
shared/lib/libXdamage.so.1.1.0
|
||||
shared/lib/libXcomposite.so.1.0.0
|
||||
shared/lib/libXrandr.so.2.2.0
|
||||
shared/lib/libXinerama.so.1.0.0
|
||||
shared/lib/libdl.so.2
|
||||
shared/lib/libatspi.so.0.0.1
|
||||
share/glib-2.0/schemas/gschemas.compiled
|
||||
shared/lib/gio/modules/giomodule.cache
|
||||
shared/lib/gio/modules/libdconfsettings.so
|
||||
shared/lib/gio/modules/libgvfsdbus.so
|
||||
shared/lib/gvfs/libgvfscommon.so
|
||||
share/X11/xkb/rules/evdev
|
||||
share/X11/xkb/keycodes/evdev
|
||||
share/X11/xkb/keycodes/aliases
|
||||
share/X11/xkb/types/complete
|
||||
share/X11/xkb/types/basic
|
||||
share/X11/xkb/types/mousekeys
|
||||
share/X11/xkb/types/pc
|
||||
share/X11/xkb/types/iso9995
|
||||
share/X11/xkb/types/level5
|
||||
share/X11/xkb/types/extra
|
||||
share/X11/xkb/types/numpad
|
||||
share/X11/xkb/compat/complete
|
||||
share/X11/xkb/compat/basic
|
||||
share/X11/xkb/compat/ledcaps
|
||||
share/X11/xkb/compat/lednum
|
||||
share/X11/xkb/compat/iso9995
|
||||
share/X11/xkb/compat/mousekeys
|
||||
share/X11/xkb/compat/accessx
|
||||
share/X11/xkb/compat/misc
|
||||
share/X11/xkb/compat/ledscroll
|
||||
share/X11/xkb/compat/xfree86
|
||||
share/X11/xkb/compat/level5
|
||||
share/X11/xkb/compat/caps
|
||||
share/X11/xkb/symbols/pc
|
||||
share/X11/xkb/symbols/srvr_ctrl
|
||||
share/X11/xkb/symbols/keypad
|
||||
share/X11/xkb/symbols/altwin
|
||||
share/X11/xkb/symbols/us
|
||||
share/X11/xkb/symbols/inet
|
||||
shared/lib/qt6/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
|
||||
shared/lib/qt6/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so
|
||||
shared/lib/qt6/plugins/iconengines/libqsvgicon.so
|
||||
shared/lib/qt6/plugins/imageformats/libqgif.so
|
||||
shared/lib/qt6/plugins/imageformats/libqico.so
|
||||
shared/lib/qt6/plugins/imageformats/libqjpeg.so
|
||||
shared/lib/qt6/plugins/imageformats/libqsvg.so
|
||||
shared/lib/libQt6Svg.so.6.4.2
|
||||
etc/fonts/fonts.conf
|
||||
shared/lib/qt6/plugins/wayland-shell-integration/libfullscreen-shell-v1.so
|
||||
shared/lib/qt6/plugins/wayland-shell-integration/libivi-shell.so
|
||||
shared/lib/qt6/plugins/wayland-shell-integration/libqt-shell.so
|
||||
shared/lib/qt6/plugins/wayland-shell-integration/libwl-shell-plugin.so
|
||||
shared/lib/qt6/plugins/wayland-shell-integration/libxdg-shell.so
|
||||
shared/lib/qt6/plugins/wayland-graphics-integration-client/libdmabuf-server.so
|
||||
shared/lib/qt6/plugins/wayland-graphics-integration-client/libdrm-egl-server.so
|
||||
shared/lib/qt6/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so
|
||||
shared/lib/qt6/plugins/wayland-graphics-integration-client/libshm-emulation-server.so
|
||||
shared/lib/qt6/plugins/wayland-graphics-integration-client/libvulkan-server.so
|
||||
shared/lib/libQt6WaylandEglClientHwIntegration.so.6.4.2
|
||||
shared/lib/libQt6OpenGL.so.6.4.2
|
||||
share/glvnd/egl_vendor.d/50_mesa.json
|
||||
shared/lib/libEGL_mesa.so.0.0.0
|
||||
shared/lib/libgbm.so.1.0.0
|
||||
shared/lib/libglapi.so.0.0.0
|
||||
shared/lib/libxcb-dri2.so.0.0.0
|
||||
shared/lib/libwayland-server.so.0.21.0
|
||||
shared/lib/dri/swrast_dri.so
|
||||
shared/lib/libsensors.so.5.0.0
|
||||
shared/lib/libdrm_radeon.so.1.0.1
|
||||
shared/lib/libdrm_nouveau.so.2.0.0
|
||||
shared/lib/libdrm_intel.so.1.0.0
|
||||
shared/lib/libpciaccess.so.0.11.1
|
||||
shared/lib/qt6/plugins/wayland-decoration-client/libbradient.so
|
||||
shared/lib/gtk-3.0/modules/libcanberra-gtk3-module.so
|
||||
shared/lib/libcanberra-gtk3.so.0.1.9
|
||||
shared/lib/libcanberra.so.0.2.5
|
||||
shared/lib/libvorbisfile.so.3.3.8
|
||||
shared/lib/libtdb.so.1.4.8
|
||||
shared/lib/libltdl.so.7.3.2
|
||||
shared/lib/libXss.so.1.0.0
|
||||
@@ -1,153 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# This script assumes you're in the source directory
|
||||
|
||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||
export BASE_ARCH="$(uname -m)"
|
||||
|
||||
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-${BASE_ARCH}-aio"
|
||||
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-${BASE_ARCH}"
|
||||
|
||||
case "$1" in
|
||||
amd64|"")
|
||||
echo "Packaging amd64-v3 optimized build of Eden"
|
||||
ARCH="amd64_v3"
|
||||
;;
|
||||
steamdeck|zen2)
|
||||
echo "Packaging Steam Deck (Zen 2) optimized build of Eden"
|
||||
ARCH="steamdeck"
|
||||
;;
|
||||
rog-ally|allyx|zen4)
|
||||
echo "Packaging ROG Ally X (Zen 4) optimized build of Eden"
|
||||
ARCH="rog-ally-x"
|
||||
;;
|
||||
legacy)
|
||||
echo "Packaging amd64 generic build of Eden"
|
||||
ARCH=amd64
|
||||
;;
|
||||
aarch64)
|
||||
echo "Packaging armv8-a build of Eden"
|
||||
ARCH=aarch64
|
||||
;;
|
||||
armv9)
|
||||
echo "Packaging armv9-a build of Eden"
|
||||
ARCH=armv9
|
||||
;;
|
||||
native)
|
||||
echo "Packaging native build of Eden"
|
||||
ARCH="$BASE_ARCH"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
export BUILDDIR="$2"
|
||||
|
||||
if [ "$BUILDDIR" = '' ]
|
||||
then
|
||||
BUILDDIR=build
|
||||
fi
|
||||
|
||||
EDEN_TAG=$(git describe --tags --abbrev=0)
|
||||
echo "Making \"$EDEN_TAG\" build"
|
||||
# git checkout "$EDEN_TAG"
|
||||
VERSION="$(echo "$EDEN_TAG")"
|
||||
|
||||
# NOW MAKE APPIMAGE
|
||||
mkdir -p ./AppDir
|
||||
cd ./AppDir
|
||||
|
||||
cp ../dist/dev.eden_emu.eden.desktop .
|
||||
cp ../dist/dev.eden_emu.eden.svg .
|
||||
|
||||
ln -sf ./dev.eden_emu.eden.svg ./.DirIcon
|
||||
|
||||
UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync'
|
||||
|
||||
if [ "$DEVEL" = 'true' ]; then
|
||||
sed -i 's|Name=Eden|Name=Eden Nightly|' ./dev.eden_emu.eden.desktop
|
||||
UPINFO="$(echo "$UPINFO" | sed 's|Releases|nightly|')"
|
||||
fi
|
||||
|
||||
LIBDIR="/usr/lib"
|
||||
|
||||
# Workaround for Gentoo
|
||||
if [ ! -d "$LIBDIR/qt6" ]
|
||||
then
|
||||
LIBDIR="/usr/lib64"
|
||||
fi
|
||||
|
||||
# Workaround for Debian
|
||||
if [ ! -d "$LIBDIR/qt6" ]
|
||||
then
|
||||
LIBDIR="/usr/lib/${BASE_ARCH}-linux-gnu"
|
||||
fi
|
||||
|
||||
# Bundle all libs
|
||||
|
||||
wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio
|
||||
chmod +x ./sharun-aio
|
||||
xvfb-run -a ./sharun-aio l -p -v -e -s -k \
|
||||
../$BUILDDIR/bin/eden* \
|
||||
$LIBDIR/lib*GL*.so* \
|
||||
$LIBDIR/dri/* \
|
||||
$LIBDIR/vdpau/* \
|
||||
$LIBDIR/libvulkan* \
|
||||
$LIBDIR/libXss.so* \
|
||||
$LIBDIR/libdecor-0.so* \
|
||||
$LIBDIR/libgamemode.so* \
|
||||
$LIBDIR/qt6/plugins/audio/* \
|
||||
$LIBDIR/qt6/plugins/bearer/* \
|
||||
$LIBDIR/qt6/plugins/imageformats/* \
|
||||
$LIBDIR/qt6/plugins/iconengines/* \
|
||||
$LIBDIR/qt6/plugins/platforms/* \
|
||||
$LIBDIR/qt6/plugins/platformthemes/* \
|
||||
$LIBDIR/qt6/plugins/platforminputcontexts/* \
|
||||
$LIBDIR/qt6/plugins/styles/* \
|
||||
$LIBDIR/qt6/plugins/xcbglintegrations/* \
|
||||
$LIBDIR/qt6/plugins/wayland-*/* \
|
||||
$LIBDIR/pulseaudio/* \
|
||||
$LIBDIR/pipewire-0.3/* \
|
||||
$LIBDIR/spa-0.2/*/* \
|
||||
$LIBDIR/alsa-lib/*
|
||||
|
||||
rm -f ./sharun-aio
|
||||
|
||||
# Prepare sharun
|
||||
if [ "$ARCH" = 'aarch64' ]; then
|
||||
# allow the host vulkan to be used for aarch64 given the sad situation
|
||||
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env
|
||||
fi
|
||||
|
||||
# Workaround for Gentoo
|
||||
if [ -d "shared/libproxy" ]; then
|
||||
cp shared/libproxy/* lib/
|
||||
fi
|
||||
|
||||
ln -f ./sharun ./AppRun
|
||||
./sharun -g
|
||||
|
||||
# turn appdir into appimage
|
||||
cd ..
|
||||
wget -q "$URUNTIME" -O ./uruntime
|
||||
chmod +x ./uruntime
|
||||
|
||||
#Add udpate info to runtime
|
||||
echo "Adding update information \"$UPINFO\" to runtime..."
|
||||
./uruntime --appimage-addupdinfo "$UPINFO"
|
||||
|
||||
echo "Generating AppImage..."
|
||||
./uruntime --appimage-mkdwarfs -f \
|
||||
--set-owner 0 --set-group 0 \
|
||||
--no-history --no-create-timestamp \
|
||||
--categorize=hotness --hotness-list=.ci/linux/eden.dwfsprof \
|
||||
--compression zstd:level=22 -S26 -B32 \
|
||||
--header uruntime \
|
||||
-N 4 \
|
||||
-i ./AppDir -o Eden-"$VERSION"-"$ARCH".AppImage
|
||||
|
||||
echo "Generating zsync file..."
|
||||
zsyncmake *.AppImage -u *.AppImage
|
||||
echo "All Done!"
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
if [ "$COMPILER" == "clang" ]
|
||||
then
|
||||
EXTRA_CMAKE_FLAGS+=(
|
||||
-DCMAKE_CXX_COMPILER=clang-cl
|
||||
-DCMAKE_C_COMPILER=clang-cl
|
||||
-DCMAKE_CXX_FLAGS="-O3"
|
||||
-DCMAKE_C_FLAGS="-O3"
|
||||
)
|
||||
|
||||
BUILD_TYPE="RelWithDebInfo"
|
||||
fi
|
||||
|
||||
[ -z "$WINDEPLOYQT" ] && { echo "WINDEPLOYQT environment variable required."; exit 1; }
|
||||
|
||||
echo $EXTRA_CMAKE_FLAGS
|
||||
|
||||
mkdir -p build && cd build
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE="${BUILD_TYPE:-Release}" \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
-DYUZU_USE_BUNDLED_SDL2=ON \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DYUZU_TESTS=OFF \
|
||||
-DDYNARMIC_TESTS=OFF \
|
||||
-DYUZU_CMD=OFF \
|
||||
-DYUZU_ROOM_STANDALONE=OFF \
|
||||
-DYUZU_USE_QT_MULTIMEDIA=${USE_MULTIMEDIA:-false} \
|
||||
-DYUZU_USE_QT_WEB_ENGINE=${USE_WEBENGINE:-false} \
|
||||
-DENABLE_LTO=ON \
|
||||
-DCMAKE_EXE_LINKER_FLAGS=" /LTCG" \
|
||||
-DYUZU_USE_BUNDLED_QT=${BUNDLE_QT:-false} \
|
||||
-DUSE_CCACHE=${CCACHE:-false} \
|
||||
-DENABLE_UPDATE_CHECKER=${DEVEL:-true} \
|
||||
"${EXTRA_CMAKE_FLAGS[@]}" \
|
||||
"$@"
|
||||
|
||||
ninja
|
||||
|
||||
set +e
|
||||
rm -f bin/*.pdb
|
||||
set -e
|
||||
|
||||
$WINDEPLOYQT --release --no-compiler-runtime --no-opengl-sw --no-system-dxc-compiler --no-system-d3d-compiler --dir pkg bin/eden.exe
|
||||
|
||||
cp bin/* pkg
|
||||
@@ -1,18 +0,0 @@
|
||||
GITDATE=$(git show -s --date=short --format='%ad' | tr -d "-")
|
||||
GITREV=$(git show -s --format='%h')
|
||||
|
||||
ZIP_NAME="Eden-Windows-${ARCH}-${GITDATE}-${GITREV}.zip"
|
||||
|
||||
ARTIFACTS_DIR="artifacts"
|
||||
PKG_DIR="build/pkg"
|
||||
|
||||
mkdir -p "$ARTIFACTS_DIR"
|
||||
|
||||
TMP_DIR=$(mktemp -d)
|
||||
|
||||
cp -r "$PKG_DIR"/* "$TMP_DIR"/
|
||||
cp LICENSE* README* "$TMP_DIR"/
|
||||
|
||||
7z a -tzip "$ARTIFACTS_DIR/$ZIP_NAME" "$TMP_DIR"/*
|
||||
|
||||
rm -rf "$TMP_DIR"
|
||||
+1
-14
@@ -1,19 +1,6 @@
|
||||
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
if (MSVC)
|
||||
message(WARNING "Support for the MSVC compiler has been dropped indefinitely. "
|
||||
"This is not a bug. You will not receive support with issues related "
|
||||
"to using Eden with MSVC, and there is ABSOLUTELY NO GUARANTEE that Eden "
|
||||
"can be built on MSVC. Read more on our blog: https://eden-emu.dev/blog"
|
||||
"\nConsider switching to MSYS2 instead: https://www.msys2.org")
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.50 AND NOT I_WANT_A_BROKEN_MSVC_BUILD)
|
||||
message(FATAL_ERROR "MSVC 19.50+ (Visual Studio 2026+) is entirely unsupported."
|
||||
"\nIf you *really* want to build anyways, set I_WANT_A_BROKEN_MSVC_BUILD=ON.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
|
||||
project(yuzu)
|
||||
@@ -577,7 +564,7 @@ if (ENABLE_QT)
|
||||
else()
|
||||
message(STATUS "Using system Qt")
|
||||
if (NOT Qt6_DIR)
|
||||
set(Qt6_DIR "" CACHE PATH "Additional path to search for Qt6 libraries")
|
||||
set(Qt6_DIR "" CACHE PATH "Additional path to search for Qt6 libraries like C:/Qt/6.8.3/msvc2022_64/lib/cmake/Qt6")
|
||||
endif()
|
||||
list(APPEND CMAKE_PREFIX_PATH "${Qt6_DIR}")
|
||||
endif()
|
||||
|
||||
+62
-2
@@ -35,6 +35,9 @@ This is the recommended GUI method for Linux, macOS, and Windows.
|
||||
<details>
|
||||
<summary>Click to Open</summary>
|
||||
|
||||
> [!WARNING]
|
||||
> On MSYS2, to use Qt Creator you are recommended to *also* install Qt from the online installer, ensuring to select the "MinGW" version.
|
||||
|
||||
Open the CMakeLists.txt file in your cloned directory via File -> Open File or Project (Ctrl+O), if you didn't clone Eden via the project import tool.
|
||||
|
||||
Select your desired "kit" (usually, the default is okay). RelWithDebInfo or Release is recommended:
|
||||
@@ -55,10 +58,18 @@ Hit "Configure Project", then wait for CMake to finish configuring (may take a w
|
||||
>
|
||||
>- *CMake* **MUST** be in your PATH (and also *ninja*, if you are using it as `<GENERATOR>`)
|
||||
>- You *MUST* be in the cloned *Eden* directory
|
||||
>
|
||||
>On Windows:
|
||||
>
|
||||
> - It's recommended to install **[Ninja](https://ninja-build.org/)**
|
||||
> - You must load **Visual C++ development environment**, this can be done by running our convenience script:
|
||||
> - `tools/windows/load-msvc-env.ps1` (for PowerShell 5+)
|
||||
> - `tools/windows/load-msvc-env.sh` (for MSYS2, Git Bash, etc)
|
||||
|
||||
Available `<GENERATOR>`:
|
||||
|
||||
- MSYS2: `Ninja`
|
||||
- MSYS2: `MSYS Makefiles`
|
||||
- MSVC: `Ninja` (preferred) or `Visual Studio 17 2022`
|
||||
- macOS: `Ninja` (preferred) or `Xcode`
|
||||
- Others: `Ninja` (preferred) or `UNIX Makefiles`
|
||||
|
||||
@@ -68,12 +79,61 @@ Available `<BUILD_TYPE>`:
|
||||
- `RelWithDebInfo` (debug symbols--compiled executable will be large)
|
||||
- `Debug` (if you are using a debugger and annoyed with stuff getting optimized out)
|
||||
|
||||
Also see the root CMakeLists.txt for more build options. Usually the default will provide the best experience.
|
||||
Caveat for Debug Builds:
|
||||
|
||||
- If you're building with CCache, you will need to add the environment variable `CL` with the `/FS` flag ([Reference](https://learn.microsoft.com/pt-br/cpp/build/reference/fs-force-synchronous-pdb-writes?view=msvc-170))
|
||||
|
||||
Also see the root CMakeLists.txt for more build options. Usually the default will provide the best experience, however.
|
||||
|
||||
```sh
|
||||
cmake -S . -B build -G "<GENERATOR>" -DCMAKE_BUILD_TYPE=<BUILD_TYPE> -DYUZU_TESTS=OFF
|
||||
```
|
||||
|
||||
If you are on Windows and prefer to use Clang:
|
||||
|
||||
```sh
|
||||
cmake -S . -B build -G "<GENERATOR>" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Option C: [CLion](https://www.jetbrains.com/clion/)
|
||||
|
||||
<details>
|
||||
<summary>Click to Open</summary>
|
||||
|
||||
- Clone the Repository:
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/42481638/216899046-0d41d7d6-8e4d-4ed2-9587-b57088af5214.png" width="500">
|
||||
<img src="https://user-images.githubusercontent.com/42481638/216899061-b2ea274a-e88c-40ae-bf0b-4450b46e9fea.png" width="500">
|
||||
<img src="https://user-images.githubusercontent.com/42481638/216899076-0e5988c4-d431-4284-a5ff-9ecff973db76.png" width="500">
|
||||
|
||||
---
|
||||
|
||||
### Building & Setup
|
||||
|
||||
- Once Cloned, You will be taken to a prompt like the image below:
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/42481638/216899092-3fe4cec6-a540-44e3-9e1e-3de9c2fffc2f.png" width="500">
|
||||
|
||||
- Set the settings to the image below:
|
||||
- Change `Build type: Release`
|
||||
- Change `Name: Release`
|
||||
- Change `Toolchain Visual Studio`
|
||||
- Change `Generator: Let CMake decide`
|
||||
- Change `Build directory: build`
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/42481638/216899164-6cee8482-3d59-428f-b1bc-e6dc793c9b20.png" width="500">
|
||||
|
||||
- Click OK; now Clion will build a directory and index your code to allow for IntelliSense. Please be patient.
|
||||
- Once this process has been completed (No loading bar bottom right), you can now build eden
|
||||
- In the top right, click on the drop-down menu, select all configurations, then select eden
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/42481638/216899226-975048e9-bc6d-4ec1-bc2d-bd8a1e15ed04.png" height="500" >
|
||||
|
||||
- Now run by clicking the play button or pressing Shift+F10, and eden will auto-launch once built.
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/42481638/216899275-d514ec6a-e563-470e-81e2-3e04f0429b68.png" width="500">
|
||||
</details>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
+1
-2
@@ -38,8 +38,7 @@ You must have GDB installed for aarch64 to debug the target. Install it through
|
||||
- `sudo emerge --ask crossdev`
|
||||
- `sudo crossdev -t aarch64-unknown-linux-gnu --ex-gdb`
|
||||
|
||||
Run `./build/bin/eden-cli -c <path to your config file (see logs where you run eden normally to see where it is)> -d -g <path to game>`
|
||||
Or `Enable GDB Stub` at General > Debug, then hook up an aarch64-gdb:
|
||||
Run `./build/bin/eden-cli -c <path to your config file (see logs where you run eden normally to see where it is)> -d -g <path to game>`, or `Enable GDB Stub` at General > Debug, then hook up an aarch64-gdb:
|
||||
|
||||
- `target remote localhost:6543`
|
||||
|
||||
|
||||
+29
-16
@@ -4,15 +4,19 @@ To build Eden, you MUST have a C++ compiler.
|
||||
|
||||
* On Linux, this is usually [GCC](https://gcc.gnu.org/) 11+ or [Clang](https://clang.llvm.org/) v14+
|
||||
* GCC 12 also requires Clang 14+
|
||||
* On Windows, install **[MSYS2](https://www.msys2.org)**
|
||||
* MINGW64 is preferred for x86_64/amd64 compilation, but this is subject to change.
|
||||
* ARM should use CLANGARM64
|
||||
* On Windows, we support:
|
||||
* **[MSVC](https://visualstudio.microsoft.com/downloads/)** (default)
|
||||
* It's STRONGLY RECOMMENDED to use the **Community** option and **Visual Studio 2022**
|
||||
* You need to install: **[Desktop development with C++](https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation?view=msvc-170)**
|
||||
* **[clang-cl](https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-180)**
|
||||
* You need to install: **C++ Clang tools for Windows**
|
||||
* **[MSYS2](https://www.msys2.org)**
|
||||
* On macOS, this is Apple Clang
|
||||
* This can be installed with `xcode-select --install`
|
||||
|
||||
The following additional tools are also required:
|
||||
|
||||
* **[CMake](https://www.cmake.org/)** 3.22+
|
||||
* **[CMake](https://www.cmake.org/)** 3.22+ - already included with the Android SDK
|
||||
* **[Git](https://git-scm.com/)** for version control
|
||||
* **[Windows installer](https://gitforwindows.org)**
|
||||
* **[Python3](https://www.python.org/downloads/)** 3.10+ - necessary to download external repositories
|
||||
@@ -25,8 +29,13 @@ If you are on desktop and plan to use the Qt frontend, you *must* install Qt 6,
|
||||
|
||||
* On Linux, *BSD and macOS, this can be done by the package manager
|
||||
* If you wish to use Qt Creator, append `qtcreator` or `qt-creator` to the commands seen below.
|
||||
* MSVC/clang-cl users on Windows must install through the official [Qt](https://www.qt.io/download-qt-installer-oss) installer
|
||||
* Linux and macOS users may choose to use the installer as well.
|
||||
* MSYS2 must install Qt 6 via the package manager (`pacman`)
|
||||
* MSYS2 can also install Qt 6 via the package manager
|
||||
|
||||
* For help setting up Qt Creator, run `./install.sh -h qtcreator`
|
||||
|
||||
If you are on **Windows** and building with **MSVC** or **clang-cl**, you may go [back home](Build.md) and continue.
|
||||
|
||||
## Externals
|
||||
|
||||
@@ -35,7 +44,7 @@ The following are handled by Eden's externals:
|
||||
* [FFmpeg](https://ffmpeg.org/) (should use `-DYUZU_USE_EXTERNAL_FFMPEG=ON`)
|
||||
* [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+ (should use `-DYUZU_USE_EXTERNAL_SDL2=ON` OR `-DYUZU_USE_BUNDLED_SDL2=ON` to reduce compile time)
|
||||
|
||||
All other dependencies will be downloaded and built by [CPM](https://github.com/cpm-cmake/CPM.cmake/). System dependencies can be used if available.
|
||||
All other dependencies will be downloaded and built by [CPM](https://github.com/cpm-cmake/CPM.cmake/) if `YUZU_USE_CPM` is on, but will always use system dependencies if available (UNIX-like only):
|
||||
|
||||
* [Boost](https://www.boost.org/users/download/) 1.57.0+
|
||||
* [Catch2](https://github.com/catchorg/Catch2) 3.0.1 if `YUZU_TESTS` or `DYNARMIC_TESTS` are on
|
||||
@@ -47,23 +56,27 @@ All other dependencies will be downloaded and built by [CPM](https://github.com/
|
||||
* [zstd](https://facebook.github.io/zstd/) 1.5+
|
||||
* [enet](http://enet.bespin.org/) 1.3+
|
||||
* [Opus](https://opus-codec.org/) 1.3+
|
||||
* [SimpleIni](https://github.com/brofield/simpleini)
|
||||
* [DiscordRPC](https://github.com/eden-emulator/discord-rpc)
|
||||
* [cubeb](https://github.com/mozilla/cubeb)
|
||||
* [libusb](https://github.com/libusb/libusb)
|
||||
* [VulkanMemoryAllocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator)
|
||||
* [sirit](https://github.com/eden-emulator/sirit) 1.0.1+
|
||||
* [httplib](https://github.com/yhirose/cpp-httplib) 0.19+
|
||||
* [cpp-jwt](https://github.com/arun11299/cpp-jwt) 1.4+ - if `ENABLE_WEB_SERVICE` is on
|
||||
* [unordered-dense](https://github.com/martinus/unordered_dense)
|
||||
|
||||
Vulkan 1.4.317+ is also needed:
|
||||
Vulkan 1.3.274+ is also needed:
|
||||
|
||||
* [VulkanUtilityLibraries](https://github.com/KhronosGroup/Vulkan-Utility-Libraries)
|
||||
* [VulkanHeaders](https://github.com/KhronosGroup/Vulkan-Headers)
|
||||
* [SPIRV-Tools](https://github.com/KhronosGroup/SPIRV-Tools)
|
||||
* [SPIRV-Headers](https://github.com/KhronosGroup/SPIRV-Headers)
|
||||
|
||||
Certain other dependencies will be fetched by CPM regardless. System packages *can* be used for these libraries, but many are either not packaged by most distributions OR have issues when used by the system:
|
||||
|
||||
* [SimpleIni](https://github.com/brofield/simpleini)
|
||||
* [DiscordRPC](https://github.com/eden-emulator/discord-rpc)
|
||||
* [cubeb](https://github.com/mozilla/cubeb)
|
||||
* [libusb](https://github.com/libusb/libusb)
|
||||
* [VulkanMemoryAllocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator)
|
||||
* [sirit](https://github.com/eden-emulator/sirit)
|
||||
* [httplib](https://github.com/yhirose/cpp-httplib) - if `ENABLE_UPDATE_CHECKER` or `ENABLE_WEB_SERVICE` are on
|
||||
* This package is known to be broken on the AUR.
|
||||
* [cpp-jwt](https://github.com/arun11299/cpp-jwt) 1.4+ - if `ENABLE_WEB_SERVICE` is on
|
||||
* [unordered-dense](https://github.com/martinus/unordered_dense)
|
||||
|
||||
On amd64:
|
||||
|
||||
* [xbyak](https://github.com/herumi/xbyak) - 7.22 or earlier is recommended
|
||||
|
||||
+14
-121
@@ -1,9 +1,11 @@
|
||||
# Development guidelines
|
||||
|
||||
## License Headers
|
||||
|
||||
All commits must have proper license header accreditation.
|
||||
|
||||
You can easily add all necessary license headers by running:
|
||||
|
||||
```sh
|
||||
git fetch origin master:master
|
||||
.ci/license-header.sh -u -c
|
||||
@@ -11,6 +13,7 @@ git push
|
||||
```
|
||||
|
||||
Alternatively, you may omit `-c` and do an amend commit:
|
||||
|
||||
```sh
|
||||
git fetch origin master:master
|
||||
.ci/license-header.sh
|
||||
@@ -22,8 +25,10 @@ If the work is licensed/vendored from other people or projects, you may omit the
|
||||
For more information on the license header script, run `.ci/license-header.sh -h`.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
Pull requests are only to be merged by core developers when properly tested and discussions conclude on Discord or other communication channels. Labels are recommended but not required. However, all PRs MUST be namespaced and optionally typed:
|
||||
```
|
||||
|
||||
```txt
|
||||
[cmake] refactor: CPM over submodules
|
||||
[desktop] feat: implement firmware install from ZIP
|
||||
[hle] stub fw20 functions
|
||||
@@ -34,7 +39,7 @@ Pull requests are only to be merged by core developers when properly tested and
|
||||
- The level of namespacing is generally left to the committer's choice.
|
||||
- However, we never recommend going more than two levels *except* in `hle`, in which case you may go as many as four levels depending on the specificity of your changes.
|
||||
- Ocassionally, up to two additional namespaces may be provided for more clarity.
|
||||
* Changes that affect the entire project (sans CMake changes) should be namespaced as `meta`.
|
||||
- Changes that affect the entire project (sans CMake changes) should be namespaced as `meta`.
|
||||
- Maintainers are permitted to change namespaces at will.
|
||||
- Commits within PRs are not required to be namespaced, but it is highly recommended.
|
||||
|
||||
@@ -50,6 +55,7 @@ When adding new settings, use `tr("Setting:")` if the setting is meant to be a f
|
||||
- Try to not write "slow/fast" options unless it clearly degrades/increases performance for a given case, as most options may modify behaviour that result in different metrics accross different systems. If for example the option is an "accuracy" option, writing "High" is sufficient to imply "Slow". No need to write "High (Slow)".
|
||||
|
||||
Some examples:
|
||||
|
||||
- "[...] negatively affecting image quality", "[...] degrading image quality": Same wording but with less filler.
|
||||
- "[...] this may cause some glitches or crashes in some games", "[...] this may cause soft-crashes": Crashes implies there may be glitches (as crashes are technically a form of a fatal glitch). The entire sentence is structured as "may cause [...] on some games", which is redundant, because "may cause [...] in games" has the same semantic meaning ("may" is a chance that it will occur on "some" given set).
|
||||
- "FIFO Relaxed is similar to FIFO [...]", "FIFO Relaxed [...]": The name already implies similarity.
|
||||
@@ -57,13 +63,16 @@ Some examples:
|
||||
- "[...] it can [...] in some cases", "[...] it can [...]": Implied probability.
|
||||
|
||||
Before adding a new setting, consider:
|
||||
|
||||
- Does the piece of code that the setting pertains to, make a significant difference if it's on/off?
|
||||
- Can it be auto-detected?
|
||||
|
||||
# IDE setup
|
||||
|
||||
## VSCode
|
||||
|
||||
Copy this to `.vscode/settings.json`, get CMake tools and it should be ready to build:
|
||||
|
||||
```json
|
||||
{
|
||||
"editor.tabSize": 4,
|
||||
@@ -83,6 +92,7 @@ You may additionally need the `Qt Extension Pack` extension if building Qt.
|
||||
# Build speedup
|
||||
|
||||
If you have an HDD, use ramdisk (build in RAM), approximatedly you need 4GB for a full build with debug symbols:
|
||||
|
||||
```sh
|
||||
mkdir /tmp/ramdisk
|
||||
chmod 777 /tmp/ramdisk
|
||||
@@ -96,128 +106,11 @@ umount /tmp/ramdisk
|
||||
# Assets and large files
|
||||
|
||||
A general rule of thumb, before uploading files:
|
||||
|
||||
- PNG files: Use [optipng](https://web.archive.org/web/20240325055059/https://optipng.sourceforge.net/).
|
||||
- SVG files: Use [svgo](https://github.com/svg/svgo).
|
||||
|
||||
May not be used but worth mentioning nonethless:
|
||||
|
||||
- OGG files: Use [OptiVorbis](https://github.com/OptiVorbis/OptiVorbis).
|
||||
- Video files: Use ffmpeg, preferably re-encode as AV1.
|
||||
|
||||
# Bisecting older commits
|
||||
|
||||
Since going into the past can be tricky (especially due to the dependencies from the project being lost thru time). This should "restore" the URLs for the respective submodules.
|
||||
|
||||
```sh
|
||||
#!/bin/sh -e
|
||||
cat > .gitmodules <<EOF
|
||||
[submodule "enet"]
|
||||
path = externals/enet
|
||||
url = https://github.com/lsalzman/enet.git
|
||||
[submodule "cubeb"]
|
||||
path = externals/cubeb
|
||||
url = https://github.com/mozilla/cubeb.git
|
||||
[submodule "dynarmic"]
|
||||
path = externals/dynarmic
|
||||
url = https://github.com/lioncash/dynarmic.git
|
||||
[submodule "libusb"]
|
||||
path = externals/libusb/libusb
|
||||
url = https://github.com/libusb/libusb.git
|
||||
[submodule "discord-rpc"]
|
||||
path = externals/discord-rpc
|
||||
url = https://github.com/yuzu-emu-mirror/discord-rpc.git
|
||||
[submodule "Vulkan-Headers"]
|
||||
path = externals/Vulkan-Headers
|
||||
url = https://github.com/KhronosGroup/Vulkan-Headers.git
|
||||
[submodule "sirit"]
|
||||
path = externals/sirit
|
||||
url = https://github.com/yuzu-emu-mirror/sirit.git
|
||||
[submodule "mbedtls"]
|
||||
path = externals/mbedtls
|
||||
url = https://github.com/yuzu-emu-mirror/mbedtls.git
|
||||
[submodule "xbyak"]
|
||||
path = externals/xbyak
|
||||
url = https://github.com/herumi/xbyak.git
|
||||
[submodule "opus"]
|
||||
path = externals/opus
|
||||
url = https://github.com/xiph/opus.git
|
||||
[submodule "SDL"]
|
||||
path = externals/SDL
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
[submodule "cpp-httplib"]
|
||||
path = externals/cpp-httplib
|
||||
url = https://github.com/yhirose/cpp-httplib.git
|
||||
[submodule "ffmpeg"]
|
||||
path = externals/ffmpeg/ffmpeg
|
||||
url = https://github.com/FFmpeg/FFmpeg.git
|
||||
[submodule "vcpkg"]
|
||||
path = externals/vcpkg
|
||||
url = https://github.com/microsoft/vcpkg.git
|
||||
[submodule "cpp-jwt"]
|
||||
path = externals/cpp-jwt
|
||||
url = https://github.com/arun11299/cpp-jwt.git
|
||||
[submodule "libadrenotools"]
|
||||
path = externals/libadrenotools
|
||||
url = https://github.com/bylaws/libadrenotools.git
|
||||
[submodule "tzdb_to_nx"]
|
||||
path = externals/nx_tzdb/tzdb_to_nx
|
||||
url = https://github.com/lat9nq/tzdb_to_nx.git
|
||||
[submodule "VulkanMemoryAllocator"]
|
||||
path = externals/VulkanMemoryAllocator
|
||||
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
|
||||
[submodule "breakpad"]
|
||||
path = externals/breakpad
|
||||
url = https://github.com/yuzu-emu-mirror/breakpad.git
|
||||
[submodule "simpleini"]
|
||||
path = externals/simpleini
|
||||
url = https://github.com/brofield/simpleini.git
|
||||
[submodule "oaknut"]
|
||||
path = externals/oaknut
|
||||
url = https://github.com/merryhime/oaknut.git
|
||||
[submodule "Vulkan-Utility-Libraries"]
|
||||
path = externals/Vulkan-Utility-Libraries
|
||||
url = https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
|
||||
[submodule "oboe"]
|
||||
path = externals/oboe
|
||||
url = https://github.com/google/oboe.git
|
||||
[submodule "externals/boost-headers"]
|
||||
path = externals/boost-headers
|
||||
url = https://github.com/boostorg/headers.git
|
||||
EOF
|
||||
git submodule sync
|
||||
update_or_checkout () {
|
||||
if [ $0 = 'externals/sirit' ] \
|
||||
|| [ $0 = 'externals/dynarmic' ] \
|
||||
|| [ $0 = 'externals/breakpad' ] \
|
||||
|| [ $0 = 'externals/discord-rpc' ] \
|
||||
|| [ $0 = 'externals/mbedtls' ]; then
|
||||
[ -f $0/CMakeLists.txt ] || git submodule update --force --remote --init -- $0
|
||||
echo $0 ':remote' && git submodule update --remote $0
|
||||
exit
|
||||
elif [ $0 = 'externals/nx_tzdb/tzdb_to_nx' ]; then
|
||||
[ -f $0/CMakeLists.txt ] || git submodule update --force --remote --init -- $0
|
||||
echo $0 ':remote' && git submodule update --remote $0
|
||||
else
|
||||
echo $0 ':update' && git submodule update --init $0 && exit
|
||||
echo $0 ':remote' && git submodule update --remote $0 && exit
|
||||
echo $0 ':failure'
|
||||
fi
|
||||
}
|
||||
export -f update_or_checkout
|
||||
grep path .gitmodules | sed 's/.*= //' | xargs -n 1 -I {} bash -c 'update_or_checkout "$@"' {}
|
||||
# Fix for LLVM builds
|
||||
sed -i 's/src\/yuzu\/main.cpp/${CMAKE_SOURCE_DIR}\/src\/yuzu\/main.cpp/g' CMakeModules/FindLLVM.cmake
|
||||
# Only after cloning and everything - fixes issues with Zydis
|
||||
cat > externals/dynarmic/src/dynarmic/common/x64_disassemble.cpp <<EOF
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
namespace Dynarmic::Common {
|
||||
void DumpDisassembledX64(const void* ptr, size_t size) {}
|
||||
std::vector<std::string> DisassembleX64(const void* ptr, size_t size) { return {}; }
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
If having issues with older artifacts, then run `rm -r externals/dynarmic/build externals/dynarmic/externals externals/nx_tzdb/tzdb_to_nx/externals externals/sirit/externals`.
|
||||
|
||||
Configuring CMake with `-DSIRIT_USE_SYSTEM_SPIRV_HEADERS=1 -DCMAKE_CXX_FLAGS="-Wno-error" -DCMAKE_C_FLAGS="-Wno-error -Wno-array-parameter -Wno-stringop-overflow"` is also recommended.
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@ To change these options, add `-DOPTION_NAME=NEWVALUE` to the command line.
|
||||
Notes:
|
||||
|
||||
- Defaults are marked per-platform.
|
||||
- "Non-UNIX" just means everything except Android (yes, macOS is UNIX)
|
||||
- "Non-UNIX" just means Windows/MSVC and Android (yes, macOS is UNIX
|
||||
- Android generally doesn't need to change anything; if you do, go to `src/android/app/build.gradle.kts`
|
||||
- To set a boolean variable to on, use `ON` for the value; to turn it off, use `OFF`
|
||||
- If a variable is mentioned as being e.g. "ON" for a specific platform(s), that means it is defaulted to OFF on others
|
||||
@@ -28,9 +28,9 @@ These options control dependencies.
|
||||
- Currently, build fails without this
|
||||
- `YUZU_TZDB_PATH` (string) Path to a pre-downloaded timezone database (useful for nixOS and Gentoo)
|
||||
- `YUZU_USE_BUNDLED_MOLTENVK` (ON, macOS only) Download bundled MoltenVK lib
|
||||
- `YUZU_USE_BUNDLED_OPENSSL` (ON for Android, Solaris, and OpenBSD) Download bundled OpenSSL build
|
||||
- `YUZU_USE_BUNDLED_OPENSSL` (ON for MSVC, Android, Solaris, and OpenBSD) Download bundled OpenSSL build
|
||||
- `YUZU_USE_EXTERNAL_SDL2` (OFF) Compiles SDL2 from source
|
||||
- `YUZU_USE_BUNDLED_SDL2` (OFF) Download a prebuilt SDL2
|
||||
- `YUZU_USE_BUNDLED_SDL2` (ON for MSVC) Download a prebuilt SDL2
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
@@ -81,7 +81,7 @@ Also desktop-only, but apply strictly to Qt
|
||||
|
||||
- `ENABLE_QT` (ON) Enable the Qt frontend (recommended)
|
||||
- `ENABLE_QT_TRANSLATION` (OFF) Enable translations for the Qt frontend
|
||||
- `YUZU_USE_BUNDLED_QT` (OFF) Download bundled Qt binaries
|
||||
- `YUZU_USE_BUNDLED_QT` (ON for MSVC) Download bundled Qt binaries
|
||||
- Not recommended on Linux. For Windows and macOS, the provided build is statically linked.
|
||||
- `YUZU_QT_MIRROR` (string) What mirror to use for downloading the bundled Qt libraries
|
||||
- `YUZU_USE_QT_MULTIMEDIA` (OFF) Use QtMultimedia for camera support
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
||||
set(PLATFORM_SUN ON)
|
||||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "OpenOrbis")
|
||||
set(PLATFORM_PS4 ON)
|
||||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "managarm")
|
||||
set(PLATFORM_MANAGARM ON)
|
||||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set(PLATFORM_FREEBSD ON)
|
||||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
||||
|
||||
Vendored
+116
-66
@@ -11,63 +11,105 @@ set(FFmpeg_HWACCEL_FLAGS)
|
||||
set(FFmpeg_HWACCEL_INCLUDE_DIRS)
|
||||
set(FFmpeg_HWACCEL_LDFLAGS)
|
||||
|
||||
if (UNIX AND NOT ANDROID)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
if (NOT ANDROID)
|
||||
pkg_check_modules(LIBVA libva)
|
||||
pkg_check_modules(CUDA cuda)
|
||||
pkg_check_modules(FFNVCODEC ffnvcodec)
|
||||
pkg_check_modules(VDPAU vdpau)
|
||||
if (NOT YUZU_USE_BUNDLED_FFMPEG)
|
||||
set(FFmpeg_CROSS_COMPILE_FLAGS "")
|
||||
if (ANDROID)
|
||||
# TODO: Maybe use CMAKE_SYSROOT? and probably provide a toolchain file for android
|
||||
# I mean isn't that the "proper" way anyways?
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" FFmpeg_HOST_SYSTEM_NAME)
|
||||
set(TOOLCHAIN "${ANDROID_NDK}/toolchains/llvm/prebuilt/${FFmpeg_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
set(SYSROOT "${TOOLCHAIN}/sysroot")
|
||||
set(FFmpeg_CPU "armv8-a")
|
||||
list(APPEND FFmpeg_CROSS_COMPILE_FLAGS
|
||||
--enable-cross-compile
|
||||
--arch=arm64
|
||||
#--cpu=${FFmpeg_CPU}
|
||||
--cross-prefix="${TOOLCHAIN}/bin/aarch64-linux-android-"
|
||||
--sysroot="${SYSROOT}"
|
||||
--target-os=android
|
||||
--extra-ldflags="--ld-path=${TOOLCHAIN}/bin/ld.lld"
|
||||
--extra-ldflags="-nostdlib"
|
||||
)
|
||||
set(FFmpeg_IS_CROSS_COMPILING TRUE)
|
||||
# User attempts to do a FFmpeg cross compilation because...
|
||||
# Here we just quickly test against host/system processors not matching
|
||||
# TODO: Test for versions not matching as well?
|
||||
elseif (NOT (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES CMAKE_SYSTEM_PROCESSOR
|
||||
AND CMAKE_HOST_SYSTEM_NAME MATCHES CMAKE_SYSTEM_NAME))
|
||||
string(TOLOWER "${CMAKE_SYSTEM_NAME}" FFmpeg_SYSTEM_NAME)
|
||||
if (FFmpeg_SYSTEM_NAME STREQUAL "openorbis" OR FFmpeg_SYSTEM_NAME STREQUAL "managarm")
|
||||
set(FFmpeg_SYSTEM_NAME "none")
|
||||
endif()
|
||||
# TODO: Can we really do better? Auto-detection? Something clever?
|
||||
list(APPEND FFmpeg_CROSS_COMPILE_FLAGS
|
||||
--enable-cross-compile
|
||||
--arch="${CMAKE_SYSTEM_PROCESSOR}"
|
||||
--target-os="${FFmpeg_SYSTEM_NAME}"
|
||||
--sysroot="${CMAKE_SYSROOT}"
|
||||
)
|
||||
if (DEFINED FFmpeg_CROSS_PREFIX)
|
||||
list(APPEND FFmpeg_CROSS_COMPILE_FLAGS --cross-prefix="${FFmpeg_CROSS_PREFIX}")
|
||||
else()
|
||||
message(WARNING "Please set FFmpeg_CROSS_PREFIX to your cross toolchain prefix, for example: \${CMAKE_STAGING_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}-")
|
||||
endif()
|
||||
set(FFmpeg_IS_CROSS_COMPILING TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT APPLE)
|
||||
# In Solaris needs explicit linking for ffmpeg which links to /lib/amd64/libX11.so
|
||||
if(PLATFORM_SUN)
|
||||
find_library(LIBDRM_LIB libdrm PATHS /usr/lib/64 /usr/lib/amd64 /usr/lib)
|
||||
if(LIBDRM_LIB)
|
||||
if (PLATFORM_PS4 OR PLATFORM_MANAGARM)
|
||||
# Doesn't support VA-API, don't go thru the embarrassment of trying to enable it
|
||||
list(APPEND FFmpeg_HWACCEL_FLAGS --disable-vaapi)
|
||||
elseif (UNIX AND NOT DEFINED FFmpeg_IS_CROSS_COMPILING)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(LIBVA libva)
|
||||
pkg_check_modules(CUDA cuda)
|
||||
pkg_check_modules(FFNVCODEC ffnvcodec)
|
||||
pkg_check_modules(VDPAU vdpau)
|
||||
|
||||
find_package(X11)
|
||||
if(X11_FOUND)
|
||||
if (NOT APPLE)
|
||||
# In Solaris needs explicit linking for ffmpeg which links to /lib/amd64/libX11.so
|
||||
if(PLATFORM_SUN)
|
||||
list(APPEND FFmpeg_HWACCEL_LIBRARIES
|
||||
X11
|
||||
"${LIBDRM_LIB}")
|
||||
message(STATUS "Found libdrm at: ${LIBDRM_LIB}")
|
||||
"${CMAKE_SYSROOT}/usr/lib/xorg/amd64/libdrm.so")
|
||||
else()
|
||||
message(WARNING "libdrm not found, disabling libdrm support")
|
||||
list(APPEND FFmpeg_HWACCEL_FLAGS
|
||||
--disable-libdrm)
|
||||
pkg_check_modules(LIBDRM libdrm REQUIRED)
|
||||
list(APPEND FFmpeg_HWACCEL_LIBRARIES
|
||||
${LIBDRM_LIBRARIES})
|
||||
list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS
|
||||
${LIBDRM_INCLUDE_DIRS})
|
||||
endif()
|
||||
else()
|
||||
pkg_check_modules(LIBDRM libdrm REQUIRED)
|
||||
list(APPEND FFmpeg_HWACCEL_LIBRARIES
|
||||
${LIBDRM_LIBRARIES})
|
||||
list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS
|
||||
${LIBDRM_INCLUDE_DIRS})
|
||||
list(APPEND FFmpeg_HWACCEL_FLAGS
|
||||
--enable-libdrm)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LIBVA_FOUND)
|
||||
find_package(X11 REQUIRED)
|
||||
pkg_check_modules(LIBVA-DRM libva-drm REQUIRED)
|
||||
pkg_check_modules(LIBVA-X11 libva-x11 REQUIRED)
|
||||
list(APPEND FFmpeg_HWACCEL_LIBRARIES
|
||||
${X11_LIBRARIES}
|
||||
${LIBVA-DRM_LIBRARIES}
|
||||
${LIBVA-X11_LIBRARIES}
|
||||
${LIBVA_LIBRARIES})
|
||||
list(APPEND FFmpeg_HWACCEL_FLAGS
|
||||
--enable-hwaccel=h264_vaapi
|
||||
--enable-hwaccel=vp8_vaapi
|
||||
--enable-hwaccel=vp9_vaapi)
|
||||
list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS
|
||||
${X11_INCLUDE_DIRS}
|
||||
${LIBVA-DRM_INCLUDE_DIRS}
|
||||
${LIBVA-X11_INCLUDE_DIRS}
|
||||
${LIBVA_INCLUDE_DIRS}
|
||||
)
|
||||
message(STATUS "ffmpeg: va-api libraries version ${LIBVA_VERSION} found")
|
||||
if(LIBVA_FOUND)
|
||||
pkg_check_modules(LIBVA-DRM libva-drm REQUIRED)
|
||||
pkg_check_modules(LIBVA-X11 libva-x11 REQUIRED)
|
||||
list(APPEND FFmpeg_HWACCEL_LIBRARIES
|
||||
${X11_LIBRARIES}
|
||||
${LIBVA-DRM_LIBRARIES}
|
||||
${LIBVA-X11_LIBRARIES}
|
||||
${LIBVA_LIBRARIES})
|
||||
list(APPEND FFmpeg_HWACCEL_FLAGS
|
||||
--enable-hwaccel=h264_vaapi
|
||||
--enable-hwaccel=vp8_vaapi
|
||||
--enable-hwaccel=vp9_vaapi)
|
||||
list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS
|
||||
${X11_INCLUDE_DIRS}
|
||||
${LIBVA-DRM_INCLUDE_DIRS}
|
||||
${LIBVA-X11_INCLUDE_DIRS}
|
||||
${LIBVA_INCLUDE_DIRS}
|
||||
)
|
||||
message(STATUS "ffmpeg: va-api libraries version ${LIBVA_VERSION} found")
|
||||
else()
|
||||
list(APPEND FFmpeg_HWACCEL_FLAGS --disable-vaapi)
|
||||
message(WARNING "ffmpeg: libva-dev not found, disabling Video Acceleration API (VA-API)...")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND FFmpeg_HWACCEL_FLAGS --disable-vaapi)
|
||||
message(WARNING "ffmpeg: libva-dev not found, disabling Video Acceleration API (VA-API)...")
|
||||
message(WARNING "ffmpeg: X11 libraries not found, disabling VA-API...")
|
||||
endif()
|
||||
|
||||
if (FFNVCODEC_FOUND)
|
||||
@@ -111,6 +153,28 @@ if (UNIX AND NOT ANDROID)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (PLATFORM_PS4)
|
||||
list(APPEND FFmpeg_CROSS_COMPILE_LIBS
|
||||
-lkernel
|
||||
-lSceUserService
|
||||
-lSceSysmodule
|
||||
-lSceNet
|
||||
-lSceLibcInternal
|
||||
)
|
||||
list(APPEND FFmpeg_CROSS_COMPILE_FLAGS
|
||||
--disable-pthreads
|
||||
--extra-cflags=${CMAKE_SYSROOT}/usr/include
|
||||
--extra-cxxflags=${CMAKE_SYSROOT}/usr/include
|
||||
--extra-libs="${FFmpeg_CROSS_COMPILE_LIBS}"
|
||||
)
|
||||
elseif (PLATFORM_MANAGARM)
|
||||
# Required for proper stuff
|
||||
list(APPEND FFmpeg_CROSS_COMPILE_FLAGS
|
||||
--disable-pthreads
|
||||
--extra-libs="${FFmpeg_CROSS_COMPILE_LIBS}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if (YUZU_USE_BUNDLED_FFMPEG)
|
||||
AddJsonPackage(ffmpeg-ci)
|
||||
|
||||
@@ -181,24 +245,6 @@ else()
|
||||
|
||||
find_program(BASH_PROGRAM bash REQUIRED)
|
||||
|
||||
set(FFmpeg_CROSS_COMPILE_FLAGS "")
|
||||
if (ANDROID)
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" FFmpeg_HOST_SYSTEM_NAME)
|
||||
set(TOOLCHAIN "${ANDROID_NDK}/toolchains/llvm/prebuilt/${FFmpeg_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
set(SYSROOT "${TOOLCHAIN}/sysroot")
|
||||
set(FFmpeg_CPU "armv8-a")
|
||||
list(APPEND FFmpeg_CROSS_COMPILE_FLAGS
|
||||
--arch=arm64
|
||||
#--cpu=${FFmpeg_CPU}
|
||||
--enable-cross-compile
|
||||
--cross-prefix=${TOOLCHAIN}/bin/aarch64-linux-android-
|
||||
--sysroot=${SYSROOT}
|
||||
--target-os=android
|
||||
--extra-ldflags="--ld-path=${TOOLCHAIN}/bin/ld.lld"
|
||||
--extra-ldflags="-nostdlib"
|
||||
)
|
||||
endif()
|
||||
|
||||
# `configure` parameters builds only exactly what yuzu needs from FFmpeg
|
||||
# `--disable-vdpau` is needed to avoid linking issues
|
||||
set(FFmpeg_CC ${CMAKE_C_COMPILER_LAUNCHER} ${CMAKE_C_COMPILER})
|
||||
@@ -221,8 +267,12 @@ else()
|
||||
--enable-decoder=vp9
|
||||
--enable-filter=yadif,scale
|
||||
--enable-pic
|
||||
--cc="${FFmpeg_CC}"
|
||||
--cxx="${FFmpeg_CXX}"
|
||||
--cc=${FFmpeg_CC}
|
||||
--cxx=${FFmpeg_CXX}
|
||||
--ld=${CMAKE_LINKER}
|
||||
--extra-cflags=${CMAKE_C_FLAGS}
|
||||
--extra-cxxflags=${CMAKE_CXX_FLAGS}
|
||||
--extra-ldflags=${CMAKE_C_LINK_FLAGS}
|
||||
${FFmpeg_HWACCEL_FLAGS}
|
||||
${FFmpeg_CROSS_COMPILE_FLAGS}
|
||||
WORKING_DIRECTORY
|
||||
|
||||
+1
@@ -18,6 +18,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
||||
SKIP_CPU_INNER_INVALIDATION("skip_cpu_inner_invalidation"),
|
||||
FIX_BLOOM_EFFECTS("fix_bloom_effects"),
|
||||
EMULATE_BGR565("emulate_bgr565"),
|
||||
RESCALE_HACK("rescale_hack"),
|
||||
CPUOPT_UNSAFE_HOST_MMU("cpuopt_unsafe_host_mmu"),
|
||||
USE_DOCKED_MODE("use_docked_mode"),
|
||||
USE_AUTO_STUB("use_auto_stub"),
|
||||
|
||||
+7
@@ -747,6 +747,13 @@ abstract class SettingsItem(
|
||||
descriptionId = R.string.fix_bloom_effects_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.RESCALE_HACK,
|
||||
titleId = R.string.rescale_hack,
|
||||
descriptionId = R.string.rescale_hack_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.EMULATE_BGR565,
|
||||
|
||||
+1
@@ -293,6 +293,7 @@ class SettingsFragmentPresenter(
|
||||
add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key)
|
||||
add(BooleanSetting.FIX_BLOOM_EFFECTS.key)
|
||||
add(BooleanSetting.EMULATE_BGR565.key)
|
||||
add(BooleanSetting.RESCALE_HACK.key)
|
||||
add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key)
|
||||
add(BooleanSetting.RENDERER_ASYNCHRONOUS_GPU_EMULATION.key)
|
||||
add(BooleanSetting.RENDERER_ASYNC_PRESENTATION.key)
|
||||
|
||||
@@ -511,6 +511,8 @@
|
||||
<string name="fix_bloom_effects_description">Reduces bloom blur in LA/EOW (Adreno A6XX - A7XX/ Turnip), removes bloom in Burnout. Warning: may cause graphical artifacts in other games.</string>
|
||||
<string name="emulate_bgr565">Emulate BGR565</string>
|
||||
<string name="emulate_bgr565_description">Fixes problems with inverted colors in games or strange artifacts or strange shadows.</string>
|
||||
<string name="rescale_hack">Enable Legacy Rescale Pass</string>
|
||||
<string name="rescale_hack_description">Fixes Luigi Mansion 3 artifact lines.</string>
|
||||
<string name="renderer_asynchronous_shaders">Use asynchronous shaders</string>
|
||||
<string name="renderer_asynchronous_shaders_description">Compiles shaders asynchronously. This may reduce stutters but may also introduce glitches.</string>
|
||||
<string name="gpu_unswizzle_settings">GPU Unswizzle Settings</string>
|
||||
|
||||
+16
-42
@@ -349,35 +349,8 @@ struct Impl {
|
||||
// Well, I mean it's the default constructor!
|
||||
explicit Impl() noexcept : filter(Level::Trace) {}
|
||||
|
||||
void StartBackendThread() noexcept {
|
||||
backend_thread = std::jthread([this](std::stop_token stop_token) {
|
||||
Common::SetCurrentThreadName("Logger");
|
||||
Entry entry;
|
||||
const auto write_logs = [this, &entry]() {
|
||||
ForEachBackend([&entry](Backend& backend) {
|
||||
backend.Write(entry);
|
||||
});
|
||||
};
|
||||
do {
|
||||
message_queue.PopWait(entry, stop_token);
|
||||
write_logs();
|
||||
} while (!stop_token.stop_requested());
|
||||
// Drain the logging queue. Only writes out up to MAX_LOGS_TO_WRITE to prevent a
|
||||
// case where a system is repeatedly spamming logs even on close.
|
||||
int max_logs_to_write = filter.IsDebug() ? INT_MAX : 100;
|
||||
while (max_logs_to_write-- && message_queue.TryPop(entry))
|
||||
write_logs();
|
||||
});
|
||||
}
|
||||
|
||||
void StopBackendThread() noexcept {
|
||||
backend_thread.request_stop();
|
||||
if (backend_thread.joinable())
|
||||
backend_thread.join();
|
||||
ForEachBackend([](Backend& backend) { backend.Flush(); });
|
||||
}
|
||||
|
||||
void ForEachBackend(auto lambda) noexcept {
|
||||
template<typename F>
|
||||
void ForEachBackend(F&& lambda) noexcept {
|
||||
lambda(static_cast<Backend&>(color_console_backend));
|
||||
#ifndef __OPENORBIS__
|
||||
if (file_backend)
|
||||
@@ -402,9 +375,7 @@ struct Impl {
|
||||
#ifdef ANDROID
|
||||
LogcatBackend lc_backend{};
|
||||
#endif
|
||||
MPSCQueue<Entry> message_queue{};
|
||||
std::chrono::steady_clock::time_point time_origin{std::chrono::steady_clock::now()};
|
||||
std::jthread backend_thread;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
@@ -428,13 +399,11 @@ void Initialize() {
|
||||
}
|
||||
|
||||
void Start() {
|
||||
if (logging_instance)
|
||||
logging_instance->StartBackendThread();
|
||||
}
|
||||
|
||||
void Stop() {
|
||||
if (logging_instance)
|
||||
logging_instance->StopBackendThread();
|
||||
logging_instance->ForEachBackend([](Backend& backend) { backend.Flush(); });
|
||||
}
|
||||
|
||||
void SetGlobalFilter(const Filter& filter) {
|
||||
@@ -449,14 +418,19 @@ void SetColorConsoleBackendEnabled(bool enabled) {
|
||||
|
||||
void FmtLogMessageImpl(Class log_class, Level log_level, const char* filename, unsigned int line_num, const char* function, fmt::string_view format, const fmt::format_args& args) {
|
||||
if (logging_instance && logging_instance->filter.CheckMessage(log_class, log_level)) {
|
||||
logging_instance->message_queue.EmplaceWait(Entry{
|
||||
.message = fmt::vformat(format, args),
|
||||
.timestamp = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - logging_instance->time_origin),
|
||||
.log_class = log_class,
|
||||
.log_level = log_level,
|
||||
.filename = TrimSourcePath(filename),
|
||||
.function = function,
|
||||
.line_num = line_num,
|
||||
auto const flush = ::Settings::values.log_flush_line.GetValue();
|
||||
logging_instance->ForEachBackend([=](Backend& backend) {
|
||||
backend.Write(Entry{
|
||||
.message = fmt::vformat(format, args),
|
||||
.timestamp = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - logging_instance->time_origin),
|
||||
.log_class = log_class,
|
||||
.log_level = log_level,
|
||||
.filename = TrimSourcePath(filename),
|
||||
.function = function,
|
||||
.line_num = line_num,
|
||||
});
|
||||
if (flush)
|
||||
backend.Flush();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <memory>
|
||||
#include "common/alignment.h"
|
||||
#include "common/literals.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "core/file_sys/sdmc_factory.h"
|
||||
#include "core/file_sys/vfs/vfs.h"
|
||||
@@ -9,8 +14,6 @@
|
||||
|
||||
namespace FileSys {
|
||||
|
||||
constexpr u64 SDMC_TOTAL_SIZE = 0x10000000000; // 1 TiB
|
||||
|
||||
SDMCFactory::SDMCFactory(VirtualDir sd_dir_, VirtualDir sd_mod_dir_)
|
||||
: sd_dir(std::move(sd_dir_)), sd_mod_dir(std::move(sd_mod_dir_)),
|
||||
contents(std::make_unique<RegisteredCache>(
|
||||
@@ -56,7 +59,11 @@ u64 SDMCFactory::GetSDMCFreeSpace() const {
|
||||
}
|
||||
|
||||
u64 SDMCFactory::GetSDMCTotalSpace() const {
|
||||
return SDMC_TOTAL_SIZE;
|
||||
// Resize the SD space automatically, always leaving around 4GiB last from next chunk block
|
||||
using namespace Common::Literals;
|
||||
auto const bytes_per_sector = 512;
|
||||
auto const size_block = (sd_dir->GetSize() + 4_GiB) / 4_GiB;
|
||||
return Common::AlignUp(size_block * 4_GiB, bytes_per_sector);
|
||||
}
|
||||
|
||||
} // namespace FileSys
|
||||
|
||||
@@ -15,86 +15,76 @@
|
||||
|
||||
namespace FileSys::SystemArchive {
|
||||
|
||||
constexpr u64 SYSTEM_ARCHIVE_BASE_TITLE_ID = 0x0100000000000800;
|
||||
constexpr std::size_t SYSTEM_ARCHIVE_COUNT = 0x28;
|
||||
|
||||
using SystemArchiveSupplier = VirtualDir (*)();
|
||||
|
||||
struct SystemArchiveDescriptor {
|
||||
u64 title_id;
|
||||
const char* name;
|
||||
SystemArchiveSupplier supplier;
|
||||
VirtualDir (*supplier)();
|
||||
};
|
||||
|
||||
constexpr std::array<SystemArchiveDescriptor, SYSTEM_ARCHIVE_COUNT> SYSTEM_ARCHIVES{{
|
||||
{0x0100000000000800, "CertStore", nullptr},
|
||||
{0x0100000000000801, "ErrorMessage", nullptr},
|
||||
{0x0100000000000802, "MiiModel", &MiiModel},
|
||||
{0x0100000000000803, "BrowserDll", nullptr},
|
||||
{0x0100000000000804, "Help", nullptr},
|
||||
{0x0100000000000805, "SharedFont", nullptr},
|
||||
{0x0100000000000806, "NgWord", &NgWord1},
|
||||
{0x0100000000000807, "SsidList", nullptr},
|
||||
{0x0100000000000808, "Dictionary", nullptr},
|
||||
{0x0100000000000809, "SystemVersion", &SystemVersion},
|
||||
{0x010000000000080A, "AvatarImage", nullptr},
|
||||
{0x010000000000080B, "LocalNews", nullptr},
|
||||
{0x010000000000080C, "Eula", nullptr},
|
||||
{0x010000000000080D, "UrlBlackList", nullptr},
|
||||
{0x010000000000080E, "TimeZoneBinary", &TimeZoneBinary},
|
||||
{0x010000000000080F, "CertStoreCruiser", nullptr},
|
||||
{0x0100000000000810, "FontNintendoExtension", &FontNintendoExtension},
|
||||
{0x0100000000000811, "FontStandard", &FontStandard},
|
||||
{0x0100000000000812, "FontKorean", &FontKorean},
|
||||
{0x0100000000000813, "FontChineseTraditional", &FontChineseTraditional},
|
||||
{0x0100000000000814, "FontChineseSimple", &FontChineseSimple},
|
||||
{0x0100000000000815, "FontBfcpx", nullptr},
|
||||
{0x0100000000000816, "SystemUpdate", nullptr},
|
||||
{0x0100000000000817, "0100000000000817", nullptr},
|
||||
{0x0100000000000818, "FirmwareDebugSettings", nullptr},
|
||||
{0x0100000000000819, "BootImagePackage", nullptr},
|
||||
{0x010000000000081A, "BootImagePackageSafe", nullptr},
|
||||
{0x010000000000081B, "BootImagePackageExFat", nullptr},
|
||||
{0x010000000000081C, "BootImagePackageExFatSafe", nullptr},
|
||||
{0x010000000000081D, "FatalMessage", nullptr},
|
||||
{0x010000000000081E, "ControllerIcon", nullptr},
|
||||
{0x010000000000081F, "PlatformConfigIcosa", nullptr},
|
||||
{0x0100000000000820, "PlatformConfigCopper", nullptr},
|
||||
{0x0100000000000821, "PlatformConfigHoag", nullptr},
|
||||
{0x0100000000000822, "ControllerFirmware", nullptr},
|
||||
{0x0100000000000823, "NgWord2", &NgWord2},
|
||||
{0x0100000000000824, "PlatformConfigIcosaMariko", nullptr},
|
||||
{0x0100000000000825, "ApplicationBlackList", nullptr},
|
||||
{0x0100000000000826, "RebootlessSystemUpdateVersion", nullptr},
|
||||
{0x0100000000000827, "ContentActionTable", nullptr},
|
||||
}};
|
||||
constexpr inline SystemArchiveDescriptor GetSystemArchive(u64 title_id) {
|
||||
switch (title_id) {
|
||||
case 0x0100000000000800: return {"CertStore", nullptr};
|
||||
case 0x0100000000000801: return {"ErrorMessage", nullptr};
|
||||
case 0x0100000000000802: return {"MiiModel", &MiiModel};
|
||||
case 0x0100000000000803: return {"BrowserDll", nullptr};
|
||||
case 0x0100000000000804: return {"Help", nullptr};
|
||||
case 0x0100000000000805: return {"SharedFont", nullptr};
|
||||
case 0x0100000000000806: return {"NgWord", &NgWord1};
|
||||
case 0x0100000000000807: return {"SsidList", nullptr};
|
||||
case 0x0100000000000808: return {"Dictionary", nullptr};
|
||||
case 0x0100000000000809: return {"SystemVersion", &SystemVersion};
|
||||
case 0x010000000000080A: return {"AvatarImage", nullptr};
|
||||
case 0x010000000000080B: return {"LocalNews", nullptr};
|
||||
case 0x010000000000080C: return {"Eula", nullptr};
|
||||
case 0x010000000000080D: return {"UrlBlackList", nullptr};
|
||||
case 0x010000000000080E: return {"TimeZoneBinary", &TimeZoneBinary};
|
||||
case 0x010000000000080F: return {"CertStoreCruiser", nullptr};
|
||||
case 0x0100000000000810: return {"FontNintendoExtension", &FontNintendoExtension};
|
||||
case 0x0100000000000811: return {"FontStandard", &FontStandard};
|
||||
case 0x0100000000000812: return {"FontKorean", &FontKorean};
|
||||
case 0x0100000000000813: return {"FontChineseTraditional", &FontChineseTraditional};
|
||||
case 0x0100000000000814: return {"FontChineseSimple", &FontChineseSimple};
|
||||
case 0x0100000000000815: return {"FontBfcpx", nullptr};
|
||||
case 0x0100000000000816: return {"SystemUpdate", nullptr};
|
||||
case 0x0100000000000817: return {"0100000000000817", nullptr};
|
||||
case 0x0100000000000818: return {"FirmwareDebugSettings", nullptr};
|
||||
case 0x0100000000000819: return {"BootImagePackage", nullptr};
|
||||
case 0x010000000000081A: return {"BootImagePackageSafe", nullptr};
|
||||
case 0x010000000000081B: return {"BootImagePackageExFat", nullptr};
|
||||
case 0x010000000000081C: return {"BootImagePackageExFatSafe", nullptr};
|
||||
case 0x010000000000081D: return {"FatalMessage", nullptr};
|
||||
case 0x010000000000081E: return {"ControllerIcon", nullptr};
|
||||
case 0x010000000000081F: return {"PlatformConfigIcosa", nullptr};
|
||||
case 0x0100000000000820: return {"PlatformConfigCopper", nullptr};
|
||||
case 0x0100000000000821: return {"PlatformConfigHoag", nullptr};
|
||||
case 0x0100000000000822: return {"ControllerFirmware", nullptr};
|
||||
case 0x0100000000000823: return {"NgWord2", &NgWord2};
|
||||
case 0x0100000000000824: return {"PlatformConfigIcosaMariko", nullptr};
|
||||
case 0x0100000000000825: return {"ApplicationBlackList", nullptr};
|
||||
case 0x0100000000000826: return {"RebootlessSystemUpdateVersion", nullptr};
|
||||
case 0x0100000000000827: return {"ContentActionTable", nullptr};
|
||||
case 0x0100000000000828: return {"FunctionBlackList", nullptr};
|
||||
case 0x0100000000000829: return {"PlatformConfigCalcio", nullptr};
|
||||
case 0x0100000000000830: return {"NgWordT", nullptr};
|
||||
case 0x0100000000000831: return {"PlatformConfigAula", nullptr};
|
||||
case 0x0100000000000832: return {"CradleFirmware", nullptr};
|
||||
case 0x0100000000000835: return {"ErrorMessageUtf8", nullptr};
|
||||
case 0x0100000000000859: return {"ClientCertData", nullptr};
|
||||
case 0x010000000000085C: return {"GameCardConfigurationData", nullptr};
|
||||
default: return {nullptr, nullptr};
|
||||
}
|
||||
}
|
||||
|
||||
VirtualFile SynthesizeSystemArchive(const u64 title_id) {
|
||||
if (title_id < SYSTEM_ARCHIVES.front().title_id || title_id > SYSTEM_ARCHIVES.back().title_id) {
|
||||
return nullptr;
|
||||
auto const desc = GetSystemArchive(title_id);
|
||||
LOG_INFO(Service_FS, "Synthesizing system archive '{}' (0x{:016X}).", desc.name, title_id);
|
||||
if (desc.supplier != nullptr) {
|
||||
if (auto const dir = desc.supplier(); dir != nullptr) {
|
||||
if (auto const romfs = CreateRomFS(dir); romfs != nullptr) {
|
||||
LOG_INFO(Service_FS, " - System archive generation successful!");
|
||||
return romfs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto& desc = SYSTEM_ARCHIVES[title_id - SYSTEM_ARCHIVE_BASE_TITLE_ID];
|
||||
|
||||
LOG_INFO(Service_FS, "Synthesizing system archive '{}' (0x{:016X}).", desc.name, desc.title_id);
|
||||
|
||||
if (desc.supplier == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const auto dir = desc.supplier();
|
||||
|
||||
if (dir == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const auto romfs = CreateRomFS(dir);
|
||||
|
||||
if (romfs == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
LOG_INFO(Service_FS, " - System archive generation successful!");
|
||||
return romfs;
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace FileSys::SystemArchive
|
||||
|
||||
@@ -53,38 +53,53 @@ public:
|
||||
{20102, nullptr, "GetFriendDetailedInfo"},
|
||||
{20103, nullptr, "SyncFriendList"},
|
||||
{20104, &IFriendService::RequestSyncFriendList, "RequestSyncFriendList"},
|
||||
{20105, &IFriendService::GetFriendListForViewer, "GetFriendListForViewer"},
|
||||
{20110, nullptr, "LoadFriendSetting"},
|
||||
{20105, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV1"},
|
||||
{20106, nullptr, "UpdateFriendInfoForViewerV1"},
|
||||
{20107, nullptr, "GetFriendDetailedInfoV2"}, // 20.0.0+
|
||||
{20108, &IFriendService::GetFriendListForViewer, "GetFriendListForViewerV2"}, // 22.0.0+
|
||||
{20109, nullptr, "UpdateFriendInfoForViewerV2"}, // 22.0.0+
|
||||
{20110, nullptr, "LoadFriendSettingV1"},
|
||||
{20111, nullptr, "LoadFriendSettingV2"}, // 22.0.0+
|
||||
{20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"},
|
||||
{20201, nullptr, "GetFriendRequestList"},
|
||||
{20201, nullptr, "GetFriendRequestListV1"},
|
||||
{20202, nullptr, "GetFriendRequestListV2"}, // 20.0.0+
|
||||
{20203, nullptr, "GetFriendRequestReceivedNotificationCount"}, // 22.0.0+
|
||||
{20300, nullptr, "GetFriendCandidateList"},
|
||||
{20301, nullptr, "GetNintendoNetworkIdInfo"},
|
||||
{20302, nullptr, "GetSnsAccountLinkage"},
|
||||
{20303, nullptr, "GetSnsAccountProfile"},
|
||||
{20304, nullptr, "GetSnsAccountFriendList"},
|
||||
{20400, nullptr, "GetBlockedUserList"},
|
||||
{20302, nullptr, "GetSnsAccountLinkage"}, // 5.0.0-19.0.1
|
||||
{20303, nullptr, "GetSnsAccountProfile"}, // 5.0.0-19.0.1
|
||||
{20304, nullptr, "GetSnsAccountFriendList"}, // 5.0.0-19.0.1
|
||||
{20400, nullptr, "GetBlockedUserListV1"},
|
||||
{20401, nullptr, "SyncBlockedUserList"},
|
||||
{20500, nullptr, "GetProfileExtraList"},
|
||||
{20402, nullptr, "GetBlockedUserListV2"}, // 20.0.0+
|
||||
{20500, nullptr, "GetProfileExtraListV1"},
|
||||
{20501, nullptr, "GetRelationship"},
|
||||
{20502, nullptr, "GetProfileExtraListV2"}, // 19.0.0+
|
||||
{20600, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV1"},
|
||||
{20601, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV2"},
|
||||
{20700, nullptr, "GetPlayHistoryList"},
|
||||
{20601, &IFriendService::GetUserPresenceView, "GetUserPresenceViewV2"}, // 19.0.0+
|
||||
{20700, nullptr, "GetPlayHistoryListV1"},
|
||||
{20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"},
|
||||
{20702, nullptr, "GetPlayHistoryListV2"}, // 19.0.0+
|
||||
{20800, &IFriendService::LoadUserSetting, "LoadUserSettingV1"},
|
||||
{20801, nullptr, "SyncUserSetting"},
|
||||
{20802, &IFriendService::LoadUserSetting, "LoadUserSettingV2"},
|
||||
{20802, &IFriendService::LoadUserSetting, "LoadUserSettingV2"}, // 19.0.0+
|
||||
{20900, &IFriendService::RequestListSummaryOverlayNotification, "RequestListSummaryOverlayNotification"},
|
||||
{21000, nullptr, "GetExternalApplicationCatalog"},
|
||||
{22000, nullptr, "GetReceivedFriendInvitationList"},
|
||||
{22001, nullptr, "GetReceivedFriendInvitationDetailedInfo"},
|
||||
{22000, nullptr, "GetReceivedFriendInvitationListV1"},
|
||||
{22001, nullptr, "GetReceivedFriendInvitationDetailedInfoV1"},
|
||||
{22002, nullptr, "GetReceivedFriendInvitationListV2"}, // 19.0.0+
|
||||
{22003, nullptr, "GetReceivedFriendInvitationDetailedInfoV2"}, // 19.0.0+
|
||||
{22010, &IFriendService::GetReceivedFriendInvitationCountCache, "GetReceivedFriendInvitationCountCache"},
|
||||
{30100, nullptr, "DropFriendNewlyFlags"},
|
||||
{30101, nullptr, "DeleteFriend"},
|
||||
{30110, nullptr, "DropFriendNewlyFlag"},
|
||||
{30120, nullptr, "ChangeFriendFavoriteFlag"},
|
||||
{30121, nullptr, "ChangeFriendOnlineNotificationFlag"},
|
||||
{30130, nullptr, "SetFriendNote"}, // 22.0.0+
|
||||
{30131, nullptr, "RequestUploadPendingNote"}, // 22.0.0+
|
||||
{30190, nullptr, "RequestSyncLocalUpdates"}, // 22.0.0+
|
||||
{30200, nullptr, "SendFriendRequest"},
|
||||
{30201, nullptr, "SendFriendRequestWithApplicationInfo"},
|
||||
{30201, nullptr, "SendFriendRequestWithApplicationInfoV1"},
|
||||
{30202, nullptr, "CancelFriendRequest"},
|
||||
{30203, nullptr, "AcceptFriendRequest"},
|
||||
{30204, nullptr, "RejectFriendRequest"},
|
||||
@@ -97,21 +112,27 @@ public:
|
||||
{30215, nullptr, "SendFriendRequestWithExternalApplicationCatalogId"},
|
||||
{30216, nullptr, "ResendFacedFriendRequest"},
|
||||
{30217, nullptr, "SendFriendRequestWithNintendoNetworkIdInfo"},
|
||||
{30300, nullptr, "GetSnsAccountLinkPageUrl"},
|
||||
{30301, nullptr, "UnlinkSnsAccount"},
|
||||
{30218, nullptr, "SendFriendRequestWithApplicationInfoV2"}, // 20.0.0+
|
||||
{30300, nullptr, "GetSnsAccountLinkPageUrl"}, // 5.0.0-19.0.1
|
||||
{30301, nullptr, "UnlinkSnsAccount"}, // 5.0.0-19.0.1
|
||||
{30400, nullptr, "BlockUser"},
|
||||
{30401, nullptr, "BlockUserWithApplicationInfo"},
|
||||
{30401, nullptr, "BlockUserWithApplicationInfoV1"},
|
||||
{30402, nullptr, "UnblockUser"},
|
||||
{30500, nullptr, "GetProfileExtraFromFriendCode"},
|
||||
{30403, nullptr, "BlockUserWithApplicationInfoV2"}, // 20.0.0+
|
||||
{30500, nullptr, "GetProfileExtraFromFriendCodeV1"},
|
||||
{30501, nullptr, "GetProfileExtraFromFriendCodeV2"}, // 19.0.0+
|
||||
{30700, nullptr, "DeletePlayHistory"},
|
||||
{30701, nullptr, "AddPlayHistoryWithApplication"}, // 19.0.0+
|
||||
{30810, nullptr, "ChangePresencePermission"},
|
||||
{30811, nullptr, "ChangeFriendRequestReception"},
|
||||
{30812, nullptr, "ChangePlayLogPermission"},
|
||||
{30820, nullptr, "IssueFriendCode"},
|
||||
{30830, nullptr, "ClearPlayLog"},
|
||||
{30900, nullptr, "SendFriendInvitation"},
|
||||
{30900, nullptr, "SendFriendInvitationV1"},
|
||||
{30901, nullptr, "SendFriendInvitationV2"}, // 19.0.0+
|
||||
{30910, nullptr, "ReadFriendInvitation"},
|
||||
{30911, nullptr, "ReadAllFriendInvitations"},
|
||||
{31000, nullptr, "OpenUser"}, // 19.0.0+
|
||||
{40100, nullptr, "DeleteFriendListCache"},
|
||||
{40400, nullptr, "DeleteBlockedUserListCache"},
|
||||
{49900, nullptr, "DeleteNetworkServiceAccountCache"},
|
||||
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Check if running as administrator
|
||||
try {
|
||||
net session 1>$null 2>$null
|
||||
} catch {
|
||||
Write-Host "This script must be run with administrator privileges!"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
$VulkanSDKVer = "1.4.341.1"
|
||||
if ((Get-WmiObject -Class Win32_ComputerSystem).SystemType -match '(x64)' -eq "True") {
|
||||
$VulkanSDKArch = "X64"
|
||||
$VulkanSDKOs = "windows"
|
||||
} else {
|
||||
$VulkanSDKArch = "ARM64"
|
||||
$VulkanSDKOs = "warm"
|
||||
}
|
||||
$VULKAN_SDK = "C:/VulkanSDK/$VulkanSDKVer"
|
||||
$ExeFile = "vulkansdk-windows-$VulkanSDKArch-$VulkanSDKVer.exe"
|
||||
$Uri = "https://sdk.lunarg.com/sdk/download/$VulkanSDKVer/$VulkanSDKOs/$ExeFile"
|
||||
$Destination = "./$ExeFile"
|
||||
|
||||
# Check if Vulkan SDK is already installed
|
||||
if (Test-Path $VULKAN_SDK) {
|
||||
Write-Host "-- Vulkan SDK already installed at $VULKAN_SDK"
|
||||
return
|
||||
}
|
||||
|
||||
echo "Downloading Vulkan SDK $VulkanSDKVer from $Uri"
|
||||
$WebClient = New-Object System.Net.WebClient
|
||||
$WebClient.DownloadFile($Uri, $Destination)
|
||||
echo "Finished downloading $ExeFile"
|
||||
|
||||
$Arguments = "--root `"$VULKAN_SDK`" --accept-licenses --default-answer --confirm-command install"
|
||||
|
||||
echo "Installing Vulkan SDK $VulkanSDKVer"
|
||||
$InstallProcess = Start-Process -FilePath $Destination -NoNewWindow -PassThru -Wait -ArgumentList $Arguments
|
||||
$ExitCode = $InstallProcess.ExitCode
|
||||
|
||||
if ($ExitCode -ne 0) {
|
||||
echo "Error installing Vulkan SDK $VulkanSDKVer (Error: $ExitCode)"
|
||||
Exit $ExitCode
|
||||
}
|
||||
|
||||
echo "Finished installing Vulkan SDK $VulkanSDKVer"
|
||||
|
||||
if ("$env:GITHUB_ACTIONS" -eq "true") {
|
||||
echo "VULKAN_SDK=$VULKAN_SDK" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "$VULKAN_SDK/Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/sh
|
||||
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
: "${VULKAN_SDK_VER:=1.4.341.1}"
|
||||
: "${VULKAN_ROOT:=C:/VulkanSDK/$VULKAN_SDK_VER}"
|
||||
VULKAN_SDK_ARCH=X64
|
||||
VULKAN_SDK_OS=windows
|
||||
case "$(uname)" in
|
||||
*ARM64*)
|
||||
VULKAN_SDK_ARCH=ARM64
|
||||
VULKAN_SDK_OS=warm
|
||||
;;
|
||||
esac
|
||||
EXE_FILE="vulkansdk-windows-$VULKAN_SDK_ARCH-$VULKAN_SDK_VER.exe"
|
||||
URI="https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/$VULKAN_SDK_OS/$EXE_FILE"
|
||||
VULKAN_ROOT_UNIX=$(cygpath -u "$VULKAN_ROOT")
|
||||
|
||||
# Check if Vulkan SDK is already installed
|
||||
if [ -d "$VULKAN_ROOT_UNIX" ]; then
|
||||
echo "-- Vulkan SDK already installed at $VULKAN_ROOT_UNIX"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Downloading Vulkan SDK $VULKAN_SDK_VER from $URI"
|
||||
[ ! -f "./$EXE_FILE" ] && curl -L -o "./$EXE_FILE" "$URI"
|
||||
chmod +x "./$EXE_FILE"
|
||||
echo "Finished downloading $EXE_FILE"
|
||||
|
||||
echo "Installing Vulkan SDK $VULKAN_SDK_VER..."
|
||||
if net session > /dev/null 2>&1; then
|
||||
./$EXE_FILE --root "$VULKAN_ROOT" --accept-licenses --default-answer --confirm-command install
|
||||
else
|
||||
echo "This script must be run with administrator privileges!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Finished installing Vulkan SDK $VULKAN_SDK_VER"
|
||||
|
||||
# GitHub Actions integration
|
||||
if [ \"${GITHUB_ACTIONS:-false}\" = \"true\" ]; then
|
||||
echo \"VULKAN_SDK=$VULKAN_ROOT\" >> \"$GITHUB_ENV\"
|
||||
echo \"$VULKAN_ROOT/bin\" >> \"$GITHUB_PATH\"
|
||||
fi
|
||||
@@ -0,0 +1,42 @@
|
||||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
$osArch = $env:PROCESSOR_ARCHITECTURE
|
||||
|
||||
switch ($osArch) {
|
||||
"AMD64" { $arch = "x64" }
|
||||
"ARM64" { $arch = "arm64" }
|
||||
default {
|
||||
Write-Error "load-msvc-env.ps1: Unsupported architecture: $osArch"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
|
||||
if (!(Test-Path $vswhere)) {
|
||||
Write-Error "load-msvc-env.ps1: vswhere not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$vs = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
|
||||
if (-not $vs) {
|
||||
Write-Error "load-msvc-env.ps1: Visual Studio (with Desktop development with C++) not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$bat = "$vs\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
|
||||
if (!(Test-Path $bat)) {
|
||||
Write-Error "load-msvc-env.ps1: (vcvarsall.bat) not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
cmd /c "`"$bat`" $arch && set" | ForEach-Object {
|
||||
if ($_ -match "^(.*?)=(.*)$") {
|
||||
[Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process')
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "load-msvc-env.ps1: MSVC environment loaded for $arch ($vs)"
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/bash
|
||||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
ARCH_RAW="$PROCESSOR_ARCHITECTURE"
|
||||
|
||||
case "$ARCH_RAW" in
|
||||
AMD64) ARCH="x64" ;;
|
||||
ARM64) ARCH="arm64" ;;
|
||||
*) echo "load-msvc-env.sh: Unsupported architecture: $ARCH_RAW"; exit 1 ;;
|
||||
esac
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
VCVARS_BASH="$SCRIPT_DIR/vcvarsall.sh"
|
||||
|
||||
if [ ! -f "$VCVARS_BASH" ]; then
|
||||
echo "load-msvc-env.sh: vcvarsall.sh not found in $SCRIPT_DIR"
|
||||
#exit 1
|
||||
fi
|
||||
chmod +x "$VCVARS_BASH"
|
||||
|
||||
eval "$("$VCVARS_BASH" "$ARCH")"
|
||||
|
||||
echo "MSVC environment loaded for $ARCH with vcvars-bash script"
|
||||
@@ -0,0 +1,433 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# SPDX-FileCopyrightText: Copyright 2023 Nathan Poirier <nathan@poirier.io>
|
||||
# SPDX-License-Identifier: MIT License
|
||||
#
|
||||
# Source: https://github.com/nathan818fr/vcvars-bash
|
||||
#
|
||||
set -Eeuo pipefail
|
||||
shopt -s inherit_errexit
|
||||
|
||||
declare -r VERSION='2025-07-09.1'
|
||||
|
||||
function detect_platform() {
|
||||
case "${OSTYPE:-}" in
|
||||
cygwin* | msys* | win32)
|
||||
declare -gr bash_platform='win_cyg'
|
||||
;;
|
||||
*)
|
||||
if [[ -n "${WSL_DISTRO_NAME:-}" ]]; then
|
||||
declare -gr bash_platform='win_wsl'
|
||||
else
|
||||
printf 'error: Unsupported platform (%s)\n' "${OSTYPE:-}" >&2
|
||||
printf 'hint: This script only supports Bash on Windows (Git Bash, WSL, etc.)\n' >&2
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function detect_mode() {
|
||||
# Detect the mode depending on the name called
|
||||
if [[ "$(basename -- "$0")" == vcvarsrun* ]]; then
|
||||
declare -gr script_mode='run' # vcvarsrun.sh
|
||||
else
|
||||
declare -gr script_mode='default' # vcvarsall.sh
|
||||
fi
|
||||
}
|
||||
|
||||
function print_usage() {
|
||||
case "$script_mode" in
|
||||
default)
|
||||
cat <<EOF
|
||||
Usage: eval "\$(vcvarsall.sh [vcvarsall.bat arguments])"
|
||||
Script version: $VERSION
|
||||
|
||||
Load MSVC environment variables using vcvarsall.bat and export them.
|
||||
The script writes a list of export commands to stdout, to be evaluated by a
|
||||
POSIX-compliant shell.
|
||||
|
||||
Example: eval "\$(vcvarsall.sh x86)"
|
||||
EOF
|
||||
;;
|
||||
run)
|
||||
cat <<EOF
|
||||
Usage: vcvarsrun.sh [vcvarsall.bat arguments] -- command [arguments...]
|
||||
Script version: $VERSION
|
||||
|
||||
Load MSVC environment variables using vcvarsall.bat and execute a command with
|
||||
them.
|
||||
|
||||
Example: vcvarsrun.sh x64 -- cl /nologo /EHsc /Fe:hello.exe hello.cpp
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
cat <<EOF
|
||||
|
||||
Environment variables:
|
||||
VSINSTALLDIR
|
||||
The path to the Visual Studio installation directory.
|
||||
Example: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community"
|
||||
Default: The latest Visual Studio installation directory found by
|
||||
vswhere.exe
|
||||
|
||||
VSWHEREPATH
|
||||
The path to the vswhere.exe executable.
|
||||
Example: "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe"
|
||||
Default: Automatically detected (in the PATH or well-known locations)
|
||||
|
||||
VSWHEREARGS
|
||||
The arguments to pass to vswhere.exe.
|
||||
This value is always automatically prefixed with "-latest -property installationPath".
|
||||
Default: "-products *"
|
||||
EOF
|
||||
local vcvarsall
|
||||
vcvarsall=$(find_vcvarsall)
|
||||
printf '\nvcvarsall.bat arguments: %s\n' "$({ cmd "$(cmdesc "$vcvarsall")" -help </dev/null 2>/dev/null || true; } | fix_crlf | sed '/^Syntax:/d; s/^ vcvarsall.bat //')"
|
||||
}
|
||||
|
||||
function main() {
|
||||
detect_platform
|
||||
detect_mode
|
||||
|
||||
# Parse arguments
|
||||
if [[ $# -eq 0 ]]; then
|
||||
print_usage >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local arg vcvarsall_args=()
|
||||
for arg in "$@"; do
|
||||
shift
|
||||
if [[ "$arg" == '--' ]]; then
|
||||
if [[ "$script_mode" == 'default' ]]; then
|
||||
printf 'error: Unexpected argument: --\n' >&2
|
||||
printf 'hint: Use vcvarsrun to run a command\n' >&2
|
||||
return 1
|
||||
fi
|
||||
break
|
||||
fi
|
||||
vcvarsall_args+=("$(cmdesc "$arg")")
|
||||
done
|
||||
|
||||
if [[ "$script_mode" == 'run' && $# -eq 0 ]]; then
|
||||
printf 'error: No command specified\n' >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Get MSVC environment variables from vcvarsall.bat
|
||||
local vcvarsall vcvarsall_env
|
||||
vcvarsall=$(find_vcvarsall)
|
||||
vcvarsall_env=$({ cmd "$(cmdesc "$vcvarsall")" "${vcvarsall_args[@]}" '&&' 'set' </dev/null || true; } | fix_crlf)
|
||||
|
||||
# Filter MSVC environment variables and export them.
|
||||
# The list of variables to export was based on a comparison between a clean environment and the vcvarsall.bat
|
||||
# environment (on different MSVC versions, tools and architectures).
|
||||
#
|
||||
# Windows environment variables are case-insensitive while Unix-like environment variables are case-sensitive, so:
|
||||
# - we always use uppercase names to prevent duplicates environment variables on the Unix-like side
|
||||
# - we also ensure that only the first occurrence of a variable is exported (see below)
|
||||
#
|
||||
# While Windows environment variables are case-insensitive, it is possible to have duplicates in some edge cases.
|
||||
# e.g. using Git Bash:
|
||||
# export xxx=1; export XXX=2; export xXx=3; cmd.exe //c set XxX=4 '&&' set
|
||||
# will output:
|
||||
# XXX=4
|
||||
# xXx=3
|
||||
# xxx=1
|
||||
|
||||
declare -A seen_vars
|
||||
function export_env() {
|
||||
local name=${1^^}
|
||||
local value=$2
|
||||
if [[ ! "$name" =~ ^[A-Z0-9_]+$ ]]; then return; fi
|
||||
if [[ -n "${seen_vars[$name]:-}" ]]; then return; fi
|
||||
seen_vars[$name]=1
|
||||
if [[ "$script_mode" == 'run' ]]; then
|
||||
export "${name}=${value}"
|
||||
else
|
||||
printf "export %s='%s'\n" "$name" "${value//\'/\'\\\'\'}"
|
||||
fi
|
||||
}
|
||||
|
||||
local name value initialized=false
|
||||
while IFS='=' read -r name value; do
|
||||
if [[ "$initialized" == 'false' ]]; then
|
||||
if [[ -n "$value" ]]; then name+="=$value"; fi
|
||||
if [[ "$name" == *' Environment initialized for: '* ]]; then initialized=true; fi
|
||||
printf '%s\n' "$name" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
case "${name^^}" in
|
||||
LIB | LIBPATH | INCLUDE | EXTERNAL_INCLUDE | COMMANDPROMPTTYPE | DEVENVDIR | EXTENSIONSDKDIR | FRAMEWORK* | \
|
||||
PLATFORM | PREFERREDTOOLARCHITECTURE | UCRT* | UNIVERSALCRTSDK* | VCIDE* | VCINSTALL* | VCPKG* | VCTOOLS* | \
|
||||
VSCMD* | VSINSTALL* | VS[0-9]* | VISUALSTUDIO* | WINDOWSLIB* | WINDOWSSDK*)
|
||||
export_env "$name" "$value"
|
||||
;;
|
||||
PATH)
|
||||
# PATH is a special case, requiring special handling
|
||||
local new_paths
|
||||
new_paths=$(pathlist_win_to_unix "$value") # Convert to unix-style path list
|
||||
new_paths=$(pathlist_normalize "${PATH}:${new_paths}") # Prepend the current PATH
|
||||
export_env 'WINDOWS_PATH' "$value"
|
||||
export_env 'PATH' "$new_paths"
|
||||
;;
|
||||
esac
|
||||
done <<<"$vcvarsall_env"
|
||||
|
||||
if [[ "$initialized" == 'false' ]]; then
|
||||
printf 'error: vcvarsall.bat failed' >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Execute command if needed
|
||||
if [[ "$script_mode" == 'run' ]]; then
|
||||
exec "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# Locate vcvarsall.bat
|
||||
# Inputs:
|
||||
# VSINSTALLDIR: The path to the Visual Studio installation directory (optional)
|
||||
# VSWHEREPATH: The path to the vswhere.exe executable (optional)
|
||||
# VSWHEREARGS: The arguments to pass to vswhere.exe (optional)
|
||||
# Outputs:
|
||||
# stdout: The windows-style path to vcvarsall.bat
|
||||
function find_vcvarsall() {
|
||||
local vsinstalldir
|
||||
if [[ -n "${VSINSTALLDIR:-}" ]]; then
|
||||
vsinstalldir="$VSINSTALLDIR"
|
||||
else
|
||||
local vswhere
|
||||
if [[ -n "${VSWHEREPATH:-}" ]]; then
|
||||
vswhere=$(unixpath "$VSWHEREPATH")
|
||||
else
|
||||
vswhere=$(command -v 'vswhere' 2>/dev/null || unixpath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe')
|
||||
fi
|
||||
|
||||
local vswhereargs=(-latest -property installationPath)
|
||||
if [[ -n "${VSWHEREARGS:-}" ]]; then
|
||||
parse_args_simple "$VSWHEREARGS"
|
||||
vswhereargs+=("${result[@]}")
|
||||
else
|
||||
vswhereargs+=(-products '*')
|
||||
fi
|
||||
|
||||
if [[ "${VCVARSBASH_DEBUG:-}" == 1 ]]; then
|
||||
printf 'debug: vswhere path: %s\n' "$vswhere" >&2
|
||||
printf 'debug: vswhere args:\n' >&2
|
||||
printf 'debug: [ %s ]\n' "${vswhereargs[@]}" >&2
|
||||
fi
|
||||
|
||||
vsinstalldir=$("$vswhere" "${vswhereargs[@]}" </dev/null | fix_crlf)
|
||||
if [[ -z "$vsinstalldir" ]]; then
|
||||
printf 'error: vswhere returned an empty installation path\n' >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
printf '%s\n' "$(winpath "$vsinstalldir")\\VC\\Auxiliary\\Build\\vcvarsall.bat"
|
||||
}
|
||||
|
||||
# Split command arguments into an array, with a simple logic
|
||||
# - Arguments are separated by whitespace (space, tab, newline, carriage return)
|
||||
# - To include whitespace in an argument, it must be enclosed in double quotes (")
|
||||
# - When inside a double-quoted argument, quotes can be escaped by doubling them ("")
|
||||
# Inputs:
|
||||
# $1: The string to parse
|
||||
# Outputs:
|
||||
# result: An array of parsed arguments
|
||||
function parse_args_simple() {
|
||||
declare -g result=()
|
||||
local str="$1 " # add a trailing space to simplify the last argument handling
|
||||
local args=()
|
||||
local current_type=none # none = waiting for next arg, normal = inside normal arg, quoted = inside quoted arg
|
||||
local current_value=''
|
||||
local i=0 len=${#str}
|
||||
while ((i < len)); do
|
||||
local c=${str:i:1}
|
||||
case "$current_type" in
|
||||
none)
|
||||
case "$c" in
|
||||
' ' | $'\t' | $'\n' | $'\r')
|
||||
# Ignore whitespace
|
||||
;;
|
||||
'"')
|
||||
# Start a quoted argument
|
||||
current_type=quoted
|
||||
current_value=''
|
||||
;;
|
||||
*)
|
||||
# Start a normal argument
|
||||
current_type=normal
|
||||
current_value="$c"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
normal)
|
||||
case "$c" in
|
||||
' ' | $'\t' | $'\n' | $'\r')
|
||||
# End of normal argument, add it to the list
|
||||
args+=("$current_value")
|
||||
current_type=none
|
||||
current_value=''
|
||||
;;
|
||||
*)
|
||||
# Continue building the normal argument
|
||||
current_value+="$c"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
quoted)
|
||||
case "$c" in
|
||||
'"')
|
||||
if [[ "${str:i+1:1}" != '"' ]]; then
|
||||
# End of quoted argument, add it to the list
|
||||
args+=("$current_value")
|
||||
current_type=none
|
||||
current_value=''
|
||||
else
|
||||
# Escaped quote, add a single quote to the current value
|
||||
current_value+='"'
|
||||
((++i)) # Skip the next quote
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Continue building the quoted argument
|
||||
current_value+="$c"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
((++i))
|
||||
done
|
||||
if [[ "$current_type" != none ]]; then
|
||||
printf 'error: Unfinished %s argument: %s\n' "$current_type" "$current_value" >&2
|
||||
return 1
|
||||
fi
|
||||
declare -g result=("${args[@]}")
|
||||
}
|
||||
|
||||
# Run a command with cmd.exe
|
||||
# Inputs:
|
||||
# $@: The command string to run (use cmdesc to escape arguments when needed)
|
||||
# Outputs:
|
||||
# stdout: The cmd.exe standard output
|
||||
# stderr: The cmd.exe error output
|
||||
function cmd() {
|
||||
# This seems to work fine on all supported platforms
|
||||
# (even with all the weird path and argument conversions on MSYS-like)
|
||||
MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*' cmd.exe /s /c " ; $* "
|
||||
}
|
||||
|
||||
# Escape a cmd.exe command argument
|
||||
# Inputs:
|
||||
# $1: The argument to escape
|
||||
# Outputs:
|
||||
# stdout: The escaped argument
|
||||
function cmdesc() {
|
||||
# shellcheck disable=SC2001
|
||||
sed 's/[^0-9A-Za-z]/^\0/g' <<<"$1"
|
||||
}
|
||||
|
||||
# Convert path to an absolute unix-style path
|
||||
# Inputs:
|
||||
# $1: The path to convert
|
||||
# Outputs:
|
||||
# stdout: The converted path
|
||||
function unixpath() {
|
||||
local path=$1
|
||||
case "$bash_platform" in
|
||||
win_wsl)
|
||||
case "$path" in
|
||||
[a-zA-Z]:\\* | [a-zA-Z]:/* | \\\\* | //*)
|
||||
# Convert windows path using wslpath (unix mode, absolute path)
|
||||
wslpath -u -a -- "$path"
|
||||
;;
|
||||
*)
|
||||
# Convert unix path using realpath
|
||||
realpath -m -- "$path"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
cygpath -u -a -- "$path"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Convert path to an absolute windows-style path
|
||||
# Inputs:
|
||||
# $1: The path to convert
|
||||
# Outputs:
|
||||
# stdout: The converted path
|
||||
function winpath() {
|
||||
local path=$1
|
||||
case "$bash_platform" in
|
||||
win_wsl)
|
||||
case "$path" in
|
||||
[a-zA-Z]:\\* | [a-zA-Z]:/* | \\\\* | //*)
|
||||
# Already a windows path
|
||||
printf '%s' "$path"
|
||||
;;
|
||||
*)
|
||||
# Convert using wslpath (windows mode, absolute path)
|
||||
wslpath -w -a -- "$path"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Convert using cygpath (windows mode, absolute path, long form)
|
||||
cygpath -w -a -l -- "$path"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Convert a windows-style path list to a unix-style path list
|
||||
# Inputs:
|
||||
# $1: The windows-style path list to convert
|
||||
# Outputs:
|
||||
# stdout: The converted unix-style path list
|
||||
function pathlist_win_to_unix() {
|
||||
local win_paths=$1
|
||||
|
||||
local path_dir first=true
|
||||
while IFS= read -r -d';' path_dir; do
|
||||
if [[ -z "$path_dir" ]]; then continue; fi
|
||||
|
||||
if [[ "$first" == 'true' ]]; then first=false; else printf ':'; fi
|
||||
printf '%s' "$(unixpath "$path_dir")"
|
||||
done <<<"${win_paths};"
|
||||
}
|
||||
|
||||
# Normalize a unix-style path list, removing duplicates and empty entries
|
||||
# Inputs:
|
||||
# $1: The list to normalize
|
||||
# Outputs:
|
||||
# stdout: The normalized path list
|
||||
function pathlist_normalize() {
|
||||
local unix_paths=$1
|
||||
|
||||
declare -A seen_paths
|
||||
local path_dir first=true
|
||||
while IFS= read -r -d ':' path_dir; do
|
||||
if [[ -z "$path_dir" ]]; then continue; fi
|
||||
if [[ -n "${seen_paths[$path_dir]:-}" ]]; then continue; fi
|
||||
seen_paths[$path_dir]=1
|
||||
|
||||
if [[ "$first" == 'true' ]]; then first=false; else printf ':'; fi
|
||||
printf '%s' "$path_dir"
|
||||
done <<<"${unix_paths}:"
|
||||
}
|
||||
|
||||
# Convert CRLF to LF
|
||||
# Inputs:
|
||||
# stdin: The input to convert
|
||||
# Outputs:
|
||||
# stdout: The converted input
|
||||
function fix_crlf() {
|
||||
sed 's/\r$//'
|
||||
}
|
||||
|
||||
eval 'main "$@";exit "$?"'
|
||||
Reference in New Issue
Block a user