New upstream version 0-1276+ds
|
@ -11,6 +11,7 @@ ccache -s
|
||||||
mkdir build || true && cd build
|
mkdir build || true && cd build
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_CXX_FLAGS="-march=x86-64-v2" \
|
||||||
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \
|
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \
|
||||||
-DCMAKE_C_COMPILER=/usr/lib/ccache/clang \
|
-DCMAKE_C_COMPILER=/usr/lib/ccache/clang \
|
||||||
-DCMAKE_INSTALL_PREFIX="/usr" \
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
||||||
|
@ -19,6 +20,7 @@ cmake .. \
|
||||||
-DENABLE_QT_TRANSLATION=ON \
|
-DENABLE_QT_TRANSLATION=ON \
|
||||||
-DUSE_DISCORD_PRESENCE=ON \
|
-DUSE_DISCORD_PRESENCE=ON \
|
||||||
-DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
|
-DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
|
||||||
|
-DYUZU_USE_BUNDLED_FFMPEG=ON \
|
||||||
-GNinja
|
-GNinja
|
||||||
|
|
||||||
ninja
|
ninja
|
||||||
|
|
|
@ -12,6 +12,7 @@ mkdir build || true && cd build
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DBoost_USE_STATIC_LIBS=ON \
|
-DBoost_USE_STATIC_LIBS=ON \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_CXX_FLAGS="-march=x86-64-v2" \
|
||||||
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
|
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
|
||||||
-DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
|
-DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
|
||||||
-DCMAKE_INSTALL_PREFIX="/usr" \
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
||||||
|
@ -33,16 +34,14 @@ DESTDIR="$PWD/AppDir" ninja install
|
||||||
rm -vf AppDir/usr/bin/yuzu-cmd AppDir/usr/bin/yuzu-tester
|
rm -vf AppDir/usr/bin/yuzu-cmd AppDir/usr/bin/yuzu-tester
|
||||||
|
|
||||||
# Download tools needed to build an AppImage
|
# Download tools needed to build an AppImage
|
||||||
wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/linuxdeploy-x86_64.AppImage
|
wget -nc https://raw.githubusercontent.com/yuzu-emu/ext-linux-bin/main/gcc/deploy-linux.sh
|
||||||
wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/linuxdeploy-plugin-qt-x86_64.AppImage
|
|
||||||
wget -nc https://raw.githubusercontent.com/yuzu-emu/AppImageKit-checkrt/old/AppRun.sh
|
wget -nc https://raw.githubusercontent.com/yuzu-emu/AppImageKit-checkrt/old/AppRun.sh
|
||||||
wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/exec-x86_64.so
|
wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/exec-x86_64.so
|
||||||
# Set executable bit
|
# Set executable bit
|
||||||
chmod 755 \
|
chmod 755 \
|
||||||
|
deploy-linux.sh \
|
||||||
AppRun.sh \
|
AppRun.sh \
|
||||||
exec-x86_64.so \
|
exec-x86_64.so \
|
||||||
linuxdeploy-x86_64.AppImage \
|
|
||||||
linuxdeploy-plugin-qt-x86_64.AppImage
|
|
||||||
|
|
||||||
# Workaround for https://github.com/AppImage/AppImageKit/issues/828
|
# Workaround for https://github.com/AppImage/AppImageKit/issues/828
|
||||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||||
|
@ -52,7 +51,7 @@ mkdir -p AppDir/usr/optional/libstdc++
|
||||||
mkdir -p AppDir/usr/optional/libgcc_s
|
mkdir -p AppDir/usr/optional/libgcc_s
|
||||||
|
|
||||||
# Deploy yuzu's needed dependencies
|
# Deploy yuzu's needed dependencies
|
||||||
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt
|
DEPLOY_QT=1 ./deploy-linux.sh AppDir/usr/bin/yuzu AppDir
|
||||||
|
|
||||||
# Workaround for libQt5MultimediaGstTools indirectly requiring libwayland-client and breaking Vulkan usage on end-user systems
|
# Workaround for libQt5MultimediaGstTools indirectly requiring libwayland-client and breaking Vulkan usage on end-user systems
|
||||||
find AppDir -type f -regex '.*libwayland-client\.so.*' -delete -print
|
find AppDir -type f -regex '.*libwayland-client\.so.*' -delete -print
|
||||||
|
|
|
@ -3,15 +3,6 @@
|
||||||
# SPDX-FileCopyrightText: 2021 yuzu Emulator Project
|
# SPDX-FileCopyrightText: 2021 yuzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
# Setup RC file for tx
|
|
||||||
cat << EOF > ~/.transifexrc
|
|
||||||
[https://www.transifex.com]
|
|
||||||
hostname = https://www.transifex.com
|
|
||||||
username = api
|
|
||||||
password = $TRANSIFEX_API_TOKEN
|
|
||||||
EOF
|
|
||||||
|
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
echo -e "\e[1m\e[33mBuild tools information:\e[0m"
|
echo -e "\e[1m\e[33mBuild tools information:\e[0m"
|
||||||
|
@ -19,9 +10,6 @@ cmake --version
|
||||||
gcc -v
|
gcc -v
|
||||||
tx --version
|
tx --version
|
||||||
|
|
||||||
# vcpkg needs these: curl zip unzip tar, have tar
|
|
||||||
apt-get install -y curl zip unzip
|
|
||||||
|
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
cmake .. -DENABLE_QT_TRANSLATION=ON -DGENERATE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SDL2=OFF -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_VCPKG=ON
|
cmake .. -DENABLE_QT_TRANSLATION=ON -DGENERATE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SDL2=OFF -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_VCPKG=ON
|
||||||
make translation
|
make translation
|
||||||
|
|
|
@ -10,13 +10,9 @@ set -e
|
||||||
ccache -sv
|
ccache -sv
|
||||||
|
|
||||||
mkdir -p build && cd build
|
mkdir -p build && cd build
|
||||||
export LDFLAGS="-fuse-ld=lld"
|
|
||||||
# -femulated-tls required due to an incompatibility between GCC and Clang
|
|
||||||
# TODO(lat9nq): If this is widespread, we probably need to add this to CMakeLists where appropriate
|
|
||||||
export CXXFLAGS="-femulated-tls"
|
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_TOOLCHAIN_FILE="${PWD}/../CMakeModules/MinGWClangCross.cmake" \
|
-DCMAKE_TOOLCHAIN_FILE="${PWD}/../CMakeModules/MinGWCross.cmake" \
|
||||||
-DDISPLAY_VERSION="$1" \
|
-DDISPLAY_VERSION="$1" \
|
||||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||||
-DENABLE_QT_TRANSLATION=ON \
|
-DENABLE_QT_TRANSLATION=ON \
|
||||||
|
|
|
@ -9,7 +9,7 @@ parameters:
|
||||||
steps:
|
steps:
|
||||||
- script: choco install vulkan-sdk
|
- script: choco install vulkan-sdk
|
||||||
displayName: 'Install vulkan-sdk'
|
displayName: 'Install vulkan-sdk'
|
||||||
- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 17 2022" -A x64 -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release -DYUZU_CRASH_DUMPS=ON .. && cd ..
|
- script: refreshenv && mkdir build && cd build && cmake -E env CXXFLAGS="/Gw /GA /Gr /Ob2" cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_POLICY_DEFAULT_CMP0069=NEW -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release -DYUZU_CRASH_DUMPS=ON .. && cd ..
|
||||||
displayName: 'Configure CMake'
|
displayName: 'Configure CMake'
|
||||||
- task: MSBuild@1
|
- task: MSBuild@1
|
||||||
displayName: 'Build'
|
displayName: 'Build'
|
||||||
|
|
10
.github/ISSUE_TEMPLATE/blank_issue_template.yml
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
name: New Issue (Developers Only)
|
||||||
|
description: A blank issue template for developers only. If you are not a developer, do not use this issue template. Your issue WILL BE CLOSED if you do not use the appropriate issue template.
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
**If you are not a developer, do not use this issue template. Your issue WILL BE CLOSED if you do not use the appropriate issue template.**
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: "Issue"
|
|
@ -1,39 +0,0 @@
|
||||||
---
|
|
||||||
name: Bug Report / Feature Request
|
|
||||||
about: Tech support does not belong here. You should only file an issue here if you think you have experienced an actual bug with yuzu or you are requesting a feature you believe would make yuzu better.
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<!---
|
|
||||||
Please keep in mind yuzu is EXPERIMENTAL SOFTWARE.
|
|
||||||
|
|
||||||
Please read the FAQ:
|
|
||||||
https://yuzu-emu.org/wiki/faq/
|
|
||||||
|
|
||||||
THIS IS NOT A SUPPORT FORUM, FOR SUPPORT GO TO:
|
|
||||||
https://community.citra-emu.org/
|
|
||||||
|
|
||||||
If the FAQ does not answer your question, please go to:
|
|
||||||
https://community.citra-emu.org/
|
|
||||||
|
|
||||||
When submitting an issue, please check the following:
|
|
||||||
|
|
||||||
- You have read the above.
|
|
||||||
- You have provided the version (commit hash) of yuzu you are using.
|
|
||||||
- You have provided sufficient detail for the issue to be reproduced.
|
|
||||||
- You have provided system specs (if relevant).
|
|
||||||
- Please also provide:
|
|
||||||
- For any issues, a log file
|
|
||||||
- For crashes, a backtrace.
|
|
||||||
- For graphical issues, comparison screenshots with real hardware.
|
|
||||||
- For emulation inaccuracies, a test-case (if able).
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
64
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
name: Bug Report
|
||||||
|
description: File a bug report
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: Tech support does not belong here. You should only file an issue here if you think you have experienced an actual bug with yuzu.
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Is there an existing issue for this?
|
||||||
|
description: Please search to see if an issue already exists for the bug you encountered.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Affected Build(s)
|
||||||
|
description: List the affected build(s) that this issue applies to.
|
||||||
|
placeholder: Mainline 1234 / Early Access 1234
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: issue-desc
|
||||||
|
attributes:
|
||||||
|
label: Description of Issue
|
||||||
|
description: A brief description of the issue encountered along with any images and/or videos.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: expected-behavior
|
||||||
|
attributes:
|
||||||
|
label: Expected Behavior
|
||||||
|
description: A brief description of how it is expected to work along with any images and/or videos.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: reproduction-steps
|
||||||
|
attributes:
|
||||||
|
label: Reproduction Steps
|
||||||
|
description: A brief explanation of how to reproduce this issue. If possible, provide a save file to aid in reproducing the issue.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: log
|
||||||
|
attributes:
|
||||||
|
label: Log File
|
||||||
|
description: A log file will help our developers to better diagnose and fix the issue.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: system-config
|
||||||
|
attributes:
|
||||||
|
label: System Configuration
|
||||||
|
placeholder: |
|
||||||
|
CPU: Intel i5-10400 / AMD Ryzen 5 3600
|
||||||
|
GPU/Driver: NVIDIA GeForce GTX 1060 (Driver 512.95)
|
||||||
|
RAM: 16GB DDR4-3200
|
||||||
|
OS: Windows 11 22H2 (Build 22621.819)
|
||||||
|
value: |
|
||||||
|
CPU:
|
||||||
|
GPU/Driver:
|
||||||
|
RAM:
|
||||||
|
OS:
|
||||||
|
validations:
|
||||||
|
required: true
|
28
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
name: Feature Request
|
||||||
|
description: File a feature request
|
||||||
|
labels: "request"
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: Tech support does not belong here. You should only file an issue here if you are requesting a feature you believe would make yuzu better.
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Is there an existing issue for this?
|
||||||
|
description: Please search to see if an issue already exists for the feature you are requesting.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: what-feature
|
||||||
|
attributes:
|
||||||
|
label: What feature are you suggesting?
|
||||||
|
description: A brief description of the requested feature.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: why-feature
|
||||||
|
attributes:
|
||||||
|
label: Why would this feature be useful?
|
||||||
|
description: A brief description of why this feature would make yuzu better.
|
||||||
|
validations:
|
||||||
|
required: true
|
4
.github/workflows/ci.yml
vendored
|
@ -19,11 +19,11 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Update Translation
|
- name: Update Translation
|
||||||
run: ./.ci/scripts/transifex/docker.sh
|
run: ./.ci/scripts/transifex/docker.sh
|
||||||
env:
|
env:
|
||||||
TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }}
|
TX_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }}
|
||||||
|
|
||||||
reuse:
|
reuse:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -132,10 +132,6 @@ Files: vcpkg.json
|
||||||
Copyright: 2022 yuzu Emulator Project
|
Copyright: 2022 yuzu Emulator Project
|
||||||
License: GPL-3.0-or-later
|
License: GPL-3.0-or-later
|
||||||
|
|
||||||
Files: .github/ISSUE_TEMPLATE/config.yml
|
Files: .github/ISSUE_TEMPLATE/*
|
||||||
Copyright: 2020 tgsm <doodrabbit@hotmail.com>
|
Copyright: 2022 yuzu Emulator Project
|
||||||
License: GPL-2.0-or-later
|
|
||||||
|
|
||||||
Files: .github/ISSUE_TEMPLATE/bug-report-feature-request.md
|
|
||||||
Copyright: 2016 MerryMage
|
|
||||||
License: GPL-2.0-or-later
|
License: GPL-2.0-or-later
|
||||||
|
|
421
CMakeLists.txt
|
@ -1,7 +1,11 @@
|
||||||
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.22)
|
||||||
|
|
||||||
|
# Dynarmic has cmake_minimum_required(3.12) and we may want to override
|
||||||
|
# some of its variables, which is only possible in 3.13+
|
||||||
|
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules")
|
||||||
|
@ -18,32 +22,39 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON
|
||||||
# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
|
# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
|
||||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
|
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
|
||||||
|
|
||||||
|
option(ENABLE_OPENGL "Enable OpenGL" ON)
|
||||||
|
mark_as_advanced(FORCE ENABLE_OPENGL)
|
||||||
option(ENABLE_QT "Enable the Qt frontend" ON)
|
option(ENABLE_QT "Enable the Qt frontend" ON)
|
||||||
|
option(ENABLE_QT6 "Allow usage of Qt6 to be attempted" OFF)
|
||||||
|
set(QT6_LOCATION "" CACHE PATH "Additional Location to search for Qt6 libraries like C:/Qt/6.3.1/msvc2019_64/")
|
||||||
|
|
||||||
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
|
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
|
||||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
|
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
|
||||||
|
|
||||||
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
||||||
|
|
||||||
option(YUZU_USE_BUNDLED_LIBUSB "Compile bundled libusb" OFF)
|
|
||||||
|
|
||||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}")
|
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}")
|
||||||
|
|
||||||
|
option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
||||||
|
|
||||||
option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
|
option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
|
||||||
|
|
||||||
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
|
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
|
||||||
|
|
||||||
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
||||||
|
|
||||||
option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON)
|
|
||||||
|
|
||||||
option(YUZU_TESTS "Compile tests" ON)
|
option(YUZU_TESTS "Compile tests" ON)
|
||||||
|
|
||||||
|
option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
|
||||||
|
|
||||||
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF)
|
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF)
|
||||||
|
|
||||||
option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
|
option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
|
||||||
|
|
||||||
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
|
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
|
||||||
|
|
||||||
|
CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF)
|
||||||
|
|
||||||
if (YUZU_USE_BUNDLED_VCPKG)
|
if (YUZU_USE_BUNDLED_VCPKG)
|
||||||
if (YUZU_TESTS)
|
if (YUZU_TESTS)
|
||||||
list(APPEND VCPKG_MANIFEST_FEATURES "yuzu-tests")
|
list(APPEND VCPKG_MANIFEST_FEATURES "yuzu-tests")
|
||||||
|
@ -59,6 +70,21 @@ elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "")
|
||||||
include("$ENV{VCPKG_TOOLCHAIN_FILE}")
|
include("$ENV{VCPKG_TOOLCHAIN_FILE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
|
if (MSVC AND CCACHE)
|
||||||
|
# buildcache does not properly cache PCH files, leading to compilation errors.
|
||||||
|
# See https://github.com/mbitsnbites/buildcache/discussions/230
|
||||||
|
message(WARNING "buildcache does not properly support Precompiled Headers. Disabling PCH")
|
||||||
|
set(DYNARMIC_USE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(YUZU_USE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
|
message(STATUS "Using Precompiled Headers.")
|
||||||
|
set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Default to a Release build
|
# Default to a Release build
|
||||||
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE)
|
if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE)
|
||||||
|
@ -133,13 +159,13 @@ if (NOT ENABLE_GENERIC)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
detect_architecture("_M_AMD64" x86_64)
|
detect_architecture("_M_AMD64" x86_64)
|
||||||
detect_architecture("_M_IX86" x86)
|
detect_architecture("_M_IX86" x86)
|
||||||
detect_architecture("_M_ARM" ARM)
|
detect_architecture("_M_ARM" arm)
|
||||||
detect_architecture("_M_ARM64" ARM64)
|
detect_architecture("_M_ARM64" arm64)
|
||||||
else()
|
else()
|
||||||
detect_architecture("__x86_64__" x86_64)
|
detect_architecture("__x86_64__" x86_64)
|
||||||
detect_architecture("__i386__" x86)
|
detect_architecture("__i386__" x86)
|
||||||
detect_architecture("__arm__" ARM)
|
detect_architecture("__arm__" arm)
|
||||||
detect_architecture("__aarch64__" ARM64)
|
detect_architecture("__aarch64__" arm64)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -175,24 +201,40 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||||
# System imported libraries
|
# System imported libraries
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
|
|
||||||
find_package(fmt 8.0.1 REQUIRED CONFIG)
|
find_package(enet 1.3)
|
||||||
find_package(nlohmann_json 3.8 REQUIRED CONFIG)
|
find_package(fmt 9 REQUIRED)
|
||||||
|
find_package(inih)
|
||||||
|
find_package(libusb 1.0.24)
|
||||||
|
find_package(lz4 REQUIRED)
|
||||||
|
find_package(nlohmann_json 3.8 REQUIRED)
|
||||||
|
find_package(Opus 1.3)
|
||||||
|
find_package(Vulkan 1.3.213)
|
||||||
find_package(ZLIB 1.2 REQUIRED)
|
find_package(ZLIB 1.2 REQUIRED)
|
||||||
|
find_package(zstd 1.5 REQUIRED)
|
||||||
|
|
||||||
# Search for config-only package first (for vcpkg), then try non-config
|
if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64)
|
||||||
find_package(zstd 1.5 CONFIG)
|
find_package(xbyak 6)
|
||||||
if (NOT zstd_FOUND)
|
|
||||||
find_package(zstd 1.5 REQUIRED)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# lz4 1.8 is required, but vcpkg's lz4-config.cmake does not have version info
|
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
|
||||||
find_package(lz4 CONFIG)
|
find_package(dynarmic 6.4.0)
|
||||||
if (NOT lz4_FOUND)
|
endif()
|
||||||
find_package(lz4 1.8 REQUIRED)
|
|
||||||
|
if (ENABLE_CUBEB)
|
||||||
|
find_package(cubeb)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (USE_DISCORD_PRESENCE)
|
||||||
|
find_package(DiscordRPC)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (ENABLE_WEB_SERVICE)
|
||||||
|
find_package(cpp-jwt 1.4)
|
||||||
|
find_package(httplib 0.11)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (YUZU_TESTS)
|
if (YUZU_TESTS)
|
||||||
find_package(Catch2 2.13.7 REQUIRED CONFIG)
|
find_package(Catch2 2.13.7 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Boost 1.73.0 COMPONENTS context)
|
find_package(Boost 1.73.0 COMPONENTS context)
|
||||||
|
@ -213,128 +255,166 @@ if (MINGW)
|
||||||
find_library(MSWSOCK_LIBRARY mswsock REQUIRED)
|
find_library(MSWSOCK_LIBRARY mswsock REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Please consider this as a stub
|
||||||
|
if(ENABLE_QT6 AND Qt6_LOCATION)
|
||||||
|
list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(set_yuzu_qt_components)
|
||||||
|
# Best practice is to ask for all components at once, so they are from the same version
|
||||||
|
set(YUZU_QT_COMPONENTS2 Core Widgets Concurrent)
|
||||||
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
|
list(APPEND YUZU_QT_COMPONENTS2 DBus)
|
||||||
|
endif()
|
||||||
|
if (YUZU_USE_QT_MULTIMEDIA)
|
||||||
|
list(APPEND YUZU_QT_COMPONENTS2 Multimedia)
|
||||||
|
endif()
|
||||||
|
if (YUZU_USE_QT_WEB_ENGINE)
|
||||||
|
list(APPEND YUZU_QT_COMPONENTS2 WebEngineCore WebEngineWidgets)
|
||||||
|
endif()
|
||||||
|
if (ENABLE_QT_TRANSLATION)
|
||||||
|
list(APPEND YUZU_QT_COMPONENTS2 LinguistTools)
|
||||||
|
endif()
|
||||||
|
set(YUZU_QT_COMPONENTS ${YUZU_QT_COMPONENTS2} PARENT_SCOPE)
|
||||||
|
endfunction(set_yuzu_qt_components)
|
||||||
|
|
||||||
# Qt5 requires that we find components, so it doesn't fit our pretty little find package function
|
# Qt5 requires that we find components, so it doesn't fit our pretty little find package function
|
||||||
if(ENABLE_QT)
|
if(ENABLE_QT)
|
||||||
set(QT_VERSION 5.15)
|
set(QT_VERSION 5.15)
|
||||||
|
# These are used to specify minimum versions
|
||||||
|
set(QT5_VERSION 5.15)
|
||||||
|
set(QT6_VERSION 6.3.1)
|
||||||
|
|
||||||
# Check for system Qt on Linux, fallback to bundled Qt
|
set_yuzu_qt_components()
|
||||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
if (ENABLE_QT6)
|
||||||
if (NOT YUZU_USE_BUNDLED_QT)
|
find_package(Qt6 ${QT6_VERSION} COMPONENTS ${YUZU_QT_COMPONENTS})
|
||||||
find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets DBus Multimedia)
|
|
||||||
endif()
|
|
||||||
if (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT)
|
|
||||||
# Check for dependencies, then enable bundled Qt download
|
|
||||||
|
|
||||||
# Check that the system GLIBCXX version is compatible
|
|
||||||
find_program(OBJDUMP objdump)
|
|
||||||
if ("${OBJDUMP}" STREQUAL "OBJDUMP-NOTFOUND")
|
|
||||||
message(FATAL_ERROR "Required program `objdump` not found.")
|
|
||||||
endif()
|
|
||||||
find_library(LIBSTDCXX libstdc++.so.6)
|
|
||||||
execute_process(
|
|
||||||
COMMAND
|
|
||||||
${OBJDUMP} -T ${LIBSTDCXX}
|
|
||||||
COMMAND
|
|
||||||
grep GLIBCXX_3.4.28
|
|
||||||
COMMAND
|
|
||||||
sed "s/[0-9a-f]*.* //"
|
|
||||||
COMMAND
|
|
||||||
sed "s/ .*//"
|
|
||||||
COMMAND
|
|
||||||
sort -u
|
|
||||||
OUTPUT_VARIABLE
|
|
||||||
GLIBCXX_MET
|
|
||||||
)
|
|
||||||
if (NOT GLIBCXX_MET)
|
|
||||||
message(FATAL_ERROR "Qt too old or not found, and bundled Qt package is not \
|
|
||||||
compatible with this system. Either install Qt ${QT_VERSION}, or provide the path \
|
|
||||||
to Qt by setting the variable Qt5_ROOT.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Check for headers
|
|
||||||
Include(FindPkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(QT_DEP_GLU QUIET glu>=9.0.0)
|
|
||||||
if (NOT QT_DEP_GLU_FOUND)
|
|
||||||
message(FATAL_ERROR "Qt bundled pacakge dependency `glu` not found. \
|
|
||||||
Perhaps `libglu1-mesa-dev` needs to be installed?")
|
|
||||||
endif()
|
|
||||||
pkg_check_modules(QT_DEP_MESA QUIET dri>=20.0.8)
|
|
||||||
if (NOT QT_DEP_MESA_FOUND)
|
|
||||||
message(FATAL_ERROR "Qt bundled pacakge dependency `dri` not found. \
|
|
||||||
Perhaps `mesa-common-dev` needs to be installed?")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Check for X libraries
|
|
||||||
set(BUNDLED_QT_REQUIREMENTS
|
|
||||||
libxcb-icccm.so.4
|
|
||||||
libxcb-image.so.0
|
|
||||||
libxcb-keysyms.so.1
|
|
||||||
libxcb-randr.so.0
|
|
||||||
libxcb-render-util.so.0
|
|
||||||
libxcb-render.so.0
|
|
||||||
libxcb-shape.so.0
|
|
||||||
libxcb-shm.so.0
|
|
||||||
libxcb-sync.so.1
|
|
||||||
libxcb-xfixes.so.0
|
|
||||||
libxcb-xinerama.so.0
|
|
||||||
libxcb-xkb.so.1
|
|
||||||
libxcb.so.1
|
|
||||||
libxkbcommon-x11.so.0
|
|
||||||
libxkbcommon.so.0
|
|
||||||
)
|
|
||||||
set(UNRESOLVED_QT_DEPS "")
|
|
||||||
foreach (REQUIREMENT ${BUNDLED_QT_REQUIREMENTS})
|
|
||||||
find_library(BUNDLED_QT_${REQUIREMENT} ${REQUIREMENT})
|
|
||||||
if ("${BUNDLED_QT_${REQUIREMENT}}" STREQUAL "BUNDLED_QT_${REQUIREMENT}-NOTFOUND")
|
|
||||||
set(UNRESOLVED_QT_DEPS ${UNRESOLVED_QT_DEPS} ${REQUIREMENT})
|
|
||||||
endif()
|
|
||||||
unset(BUNDLED_QT_${REQUIREMENT})
|
|
||||||
endforeach()
|
|
||||||
unset(BUNDLED_QT_REQUIREMENTS)
|
|
||||||
|
|
||||||
if (NOT "${UNRESOLVED_QT_DEPS}" STREQUAL "")
|
|
||||||
message(FATAL_ERROR "Bundled Qt package missing required dependencies: ${UNRESOLVED_QT_DEPS}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(YUZU_USE_BUNDLED_QT ON CACHE BOOL "Download bundled Qt" FORCE)
|
|
||||||
endif()
|
|
||||||
if (YUZU_USE_BUNDLED_QT)
|
|
||||||
# Binary package currently does not support Qt webengine, so make sure it's disabled
|
|
||||||
set(YUZU_USE_QT_WEB_ENGINE OFF CACHE BOOL "Use Qt Webengine" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
if (Qt6_FOUND)
|
||||||
set(YUZU_QT_NO_CMAKE_SYSTEM_PATH)
|
message(STATUS "yuzu/CMakeLists.txt: Qt6Widgets_VERSION ${Qt6Widgets_VERSION}, setting QT_VERSION")
|
||||||
|
set(QT_VERSION ${Qt6Widgets_VERSION})
|
||||||
if(YUZU_USE_BUNDLED_QT)
|
set(QT_MAJOR_VERSION 6)
|
||||||
if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
|
# Qt6 sets cxx_std_17 and we need to undo that
|
||||||
set(QT_BUILD qt-5.15.2-msvc2019_64)
|
set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "")
|
||||||
elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND NOT MINGW AND ARCHITECTURE_x86_64)
|
|
||||||
set(QT_BUILD qt5_5_15_2)
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable YUZU_USE_BUNDLED_QT and provide your own.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (DEFINED QT_BUILD)
|
|
||||||
download_bundled_external("qt/" ${QT_BUILD} QT_PREFIX)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
|
|
||||||
|
|
||||||
set(YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH")
|
|
||||||
endif()
|
|
||||||
if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND YUZU_USE_BUNDLED_QT)
|
|
||||||
find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets Concurrent Multimedia DBus ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH})
|
|
||||||
else()
|
else()
|
||||||
find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets Concurrent Multimedia ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH})
|
message(STATUS "yuzu/CMakeLists.txt: Qt6 not found/not selected, trying for Qt5")
|
||||||
endif()
|
# When Qt6 partially found, need this set to use Qt5 when not specifying version
|
||||||
if (YUZU_USE_QT_WEB_ENGINE)
|
set(QT_DEFAULT_MAJOR_VERSION 5)
|
||||||
find_package(Qt5 REQUIRED COMPONENTS WebEngineCore WebEngineWidgets)
|
set(QT_MAJOR_VERSION 5)
|
||||||
|
|
||||||
|
set(YUZU_USE_QT_MULTIMEDIA ON)
|
||||||
|
# Check for system Qt on Linux, fallback to bundled Qt
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
if (NOT YUZU_USE_BUNDLED_QT)
|
||||||
|
find_package(Qt5 ${QT5_VERSION} COMPONENTS Widgets DBus Multimedia)
|
||||||
|
endif()
|
||||||
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT))
|
||||||
|
# Check for dependencies, then enable bundled Qt download
|
||||||
|
|
||||||
|
# Check that the system GLIBCXX version is compatible
|
||||||
|
find_program(OBJDUMP objdump)
|
||||||
|
if (NOT OBJDUMP)
|
||||||
|
message(FATAL_ERROR "Required program `objdump` not found.")
|
||||||
|
endif()
|
||||||
|
find_library(LIBSTDCXX libstdc++.so.6)
|
||||||
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
${OBJDUMP} -T ${LIBSTDCXX}
|
||||||
|
COMMAND
|
||||||
|
grep GLIBCXX_3.4.28
|
||||||
|
COMMAND
|
||||||
|
sed "s/[0-9a-f]*.* //"
|
||||||
|
COMMAND
|
||||||
|
sed "s/ .*//"
|
||||||
|
COMMAND
|
||||||
|
sort -u
|
||||||
|
OUTPUT_VARIABLE
|
||||||
|
GLIBCXX_MET
|
||||||
|
)
|
||||||
|
if (NOT GLIBCXX_MET)
|
||||||
|
message(FATAL_ERROR "Qt too old or not found, and bundled Qt package is not \
|
||||||
|
compatible with this system. Either install Qt ${QT_VERSION}, or provide the path \
|
||||||
|
to Qt by setting the variable Qt5_ROOT.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Check for headers
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(QT_DEP_GLU QUIET glu>=9.0.0)
|
||||||
|
if (NOT QT_DEP_GLU_FOUND)
|
||||||
|
message(FATAL_ERROR "Qt bundled pacakge dependency `glu` not found. \
|
||||||
|
Perhaps `libglu1-mesa-dev` needs to be installed?")
|
||||||
|
endif()
|
||||||
|
pkg_check_modules(QT_DEP_MESA QUIET dri>=20.0.8)
|
||||||
|
if (NOT QT_DEP_MESA_FOUND)
|
||||||
|
message(FATAL_ERROR "Qt bundled pacakge dependency `dri` not found. \
|
||||||
|
Perhaps `mesa-common-dev` needs to be installed?")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Check for X libraries
|
||||||
|
set(BUNDLED_QT_REQUIREMENTS
|
||||||
|
libxcb-icccm.so.4
|
||||||
|
libxcb-image.so.0
|
||||||
|
libxcb-keysyms.so.1
|
||||||
|
libxcb-randr.so.0
|
||||||
|
libxcb-render-util.so.0
|
||||||
|
libxcb-render.so.0
|
||||||
|
libxcb-shape.so.0
|
||||||
|
libxcb-shm.so.0
|
||||||
|
libxcb-sync.so.1
|
||||||
|
libxcb-xfixes.so.0
|
||||||
|
libxcb-xinerama.so.0
|
||||||
|
libxcb-xkb.so.1
|
||||||
|
libxcb.so.1
|
||||||
|
libxkbcommon-x11.so.0
|
||||||
|
libxkbcommon.so.0
|
||||||
|
)
|
||||||
|
set(UNRESOLVED_QT_DEPS "")
|
||||||
|
foreach (REQUIREMENT ${BUNDLED_QT_REQUIREMENTS})
|
||||||
|
find_library(BUNDLED_QT_${REQUIREMENT} ${REQUIREMENT})
|
||||||
|
if (NOT BUNDLED_QT_${REQUIREMENT})
|
||||||
|
set(UNRESOLVED_QT_DEPS ${UNRESOLVED_QT_DEPS} ${REQUIREMENT})
|
||||||
|
endif()
|
||||||
|
unset(BUNDLED_QT_${REQUIREMENT})
|
||||||
|
endforeach()
|
||||||
|
unset(BUNDLED_QT_REQUIREMENTS)
|
||||||
|
|
||||||
|
if (NOT "${UNRESOLVED_QT_DEPS}" STREQUAL "")
|
||||||
|
message(FATAL_ERROR "Bundled Qt package missing required dependencies: ${UNRESOLVED_QT_DEPS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(YUZU_USE_BUNDLED_QT ON CACHE BOOL "Download bundled Qt" FORCE)
|
||||||
|
endif()
|
||||||
|
if (YUZU_USE_BUNDLED_QT)
|
||||||
|
# Binary package currently does not support Qt webengine, so make sure it's disabled
|
||||||
|
set(YUZU_USE_QT_WEB_ENGINE OFF CACHE BOOL "Use Qt Webengine" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(YUZU_QT_NO_CMAKE_SYSTEM_PATH)
|
||||||
|
|
||||||
|
if(YUZU_USE_BUNDLED_QT)
|
||||||
|
if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
|
||||||
|
set(QT_BUILD qt-5.15.2-msvc2019_64)
|
||||||
|
elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND NOT MINGW AND ARCHITECTURE_x86_64)
|
||||||
|
set(QT_BUILD qt5_5_15_2)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable YUZU_USE_BUNDLED_QT and provide your own.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (DEFINED QT_BUILD)
|
||||||
|
download_bundled_external("qt/" ${QT_BUILD} QT_PREFIX)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
|
||||||
|
|
||||||
|
set(YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH")
|
||||||
|
# Binary package for Qt5 has Qt Multimedia
|
||||||
|
set(YUZU_USE_QT_MULTIMEDIA ON CACHE BOOL "Use Qt Multimedia" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_yuzu_qt_components()
|
||||||
|
find_package(Qt5 ${QT5_VERSION} COMPONENTS ${YUZU_QT_COMPONENTS} ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_QT_TRANSLATION)
|
|
||||||
find_package(Qt5 REQUIRED COMPONENTS LinguistTools ${QT_PREFIX_HINT})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the yuzu_find_package
|
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the yuzu_find_package
|
||||||
|
@ -356,23 +436,13 @@ if (ENABLE_SDL2)
|
||||||
set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library")
|
set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library")
|
||||||
set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll")
|
set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll")
|
||||||
|
|
||||||
add_library(SDL2 INTERFACE)
|
add_library(SDL2::SDL2 INTERFACE IMPORTED)
|
||||||
target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
|
target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}")
|
||||||
target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
|
target_include_directories(SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
|
||||||
elseif (YUZU_USE_EXTERNAL_SDL2)
|
elseif (YUZU_USE_EXTERNAL_SDL2)
|
||||||
message(STATUS "Using SDL2 from externals.")
|
message(STATUS "Using SDL2 from externals.")
|
||||||
else()
|
else()
|
||||||
find_package(SDL2 2.0.18 REQUIRED)
|
find_package(SDL2 2.0.18 REQUIRED)
|
||||||
|
|
||||||
# Some installations don't set SDL2_LIBRARIES
|
|
||||||
if("${SDL2_LIBRARIES}" STREQUAL "")
|
|
||||||
message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
|
|
||||||
set(SDL2_LIBRARIES "SDL2::SDL2")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
|
|
||||||
add_library(SDL2 INTERFACE)
|
|
||||||
target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -384,25 +454,6 @@ if (TARGET Boost::boost)
|
||||||
add_library(boost ALIAS Boost::boost)
|
add_library(boost ALIAS Boost::boost)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Ensure libusb is properly configured (based on dolphin libusb include)
|
|
||||||
if(NOT APPLE AND NOT YUZU_USE_BUNDLED_LIBUSB)
|
|
||||||
include(FindPkgConfig)
|
|
||||||
if (PKG_CONFIG_FOUND AND NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
|
|
||||||
pkg_check_modules(LIBUSB QUIET libusb-1.0>=1.0.24)
|
|
||||||
else()
|
|
||||||
find_package(LibUSB)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (LIBUSB_FOUND)
|
|
||||||
add_library(usb INTERFACE)
|
|
||||||
target_include_directories(usb INTERFACE "${LIBUSB_INCLUDE_DIRS}")
|
|
||||||
target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARIES}")
|
|
||||||
else()
|
|
||||||
message(WARNING "libusb not found, falling back to externals")
|
|
||||||
set(YUZU_USE_BUNDLED_LIBUSB ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# List of all FFmpeg components required
|
# List of all FFmpeg components required
|
||||||
set(FFmpeg_COMPONENTS
|
set(FFmpeg_COMPONENTS
|
||||||
avcodec
|
avcodec
|
||||||
|
@ -410,27 +461,12 @@ set(FFmpeg_COMPONENTS
|
||||||
swscale)
|
swscale)
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
Include(FindPkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(LIBVA libva)
|
pkg_check_modules(LIBVA libva)
|
||||||
endif()
|
endif()
|
||||||
if (NOT YUZU_USE_BUNDLED_FFMPEG)
|
if (NOT YUZU_USE_BUNDLED_FFMPEG)
|
||||||
# Use system installed FFmpeg
|
# Use system installed FFmpeg
|
||||||
find_package(FFmpeg 4.3 QUIET COMPONENTS ${FFmpeg_COMPONENTS})
|
find_package(FFmpeg 4.3 REQUIRED QUIET COMPONENTS ${FFmpeg_COMPONENTS})
|
||||||
|
|
||||||
if (FFmpeg_FOUND)
|
|
||||||
# Overwrite aggregate defines from FFmpeg module to avoid over-linking libraries.
|
|
||||||
# Prevents shipping too many libraries with the AppImage.
|
|
||||||
set(FFmpeg_LIBRARIES "")
|
|
||||||
set(FFmpeg_INCLUDE_DIR "")
|
|
||||||
|
|
||||||
foreach(COMPONENT ${FFmpeg_COMPONENTS})
|
|
||||||
set(FFmpeg_LIBRARIES ${FFmpeg_LIBRARIES} ${FFmpeg_LIBRARY_${COMPONENT}} CACHE PATH "Paths to FFmpeg libraries" FORCE)
|
|
||||||
set(FFmpeg_INCLUDE_DIR ${FFmpeg_INCLUDE_DIR} ${FFmpeg_INCLUDE_${COMPONENT}} CACHE PATH "Path to FFmpeg headers" FORCE)
|
|
||||||
endforeach()
|
|
||||||
else()
|
|
||||||
message(WARNING "FFmpeg not found or too old, falling back to externals")
|
|
||||||
set(YUZU_USE_BUNDLED_FFMPEG ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Prefer the -pthread flag on Linux.
|
# Prefer the -pthread flag on Linux.
|
||||||
|
@ -541,12 +577,27 @@ add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY
|
||||||
# Adjustments for MSVC + Ninja
|
# Adjustments for MSVC + Ninja
|
||||||
if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja")
|
if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja")
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
/wd4711 # function 'function' selected for automatic inline expansion
|
|
||||||
/wd4464 # relative include path contains '..'
|
/wd4464 # relative include path contains '..'
|
||||||
/wd4820 # 'identifier1': '4' bytes padding added after data member 'identifier2'
|
/wd4711 # function 'function' selected for automatic inline expansion
|
||||||
|
/wd4820 # 'bytes' bytes padding added after construct 'member_name'
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (YUZU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
# We will assume that if the compiler is GCC, it will attempt to use ld.bfd by default.
|
||||||
|
# Try to pick a faster linker.
|
||||||
|
find_program(LLD lld)
|
||||||
|
find_program(MOLD mold)
|
||||||
|
|
||||||
|
if (MOLD AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1")
|
||||||
|
message(NOTICE "Selecting mold as linker")
|
||||||
|
add_link_options("-fuse-ld=mold")
|
||||||
|
elseif (LLD)
|
||||||
|
message(NOTICE "Selecting lld as linker")
|
||||||
|
add_link_options("-fuse-ld=lld")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_subdirectory(externals)
|
add_subdirectory(externals)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
|
@ -27,10 +27,13 @@ function(copy_yuzu_Qt5_deps target_dir)
|
||||||
Qt5Core$<$<CONFIG:Debug>:d>.*
|
Qt5Core$<$<CONFIG:Debug>:d>.*
|
||||||
Qt5Gui$<$<CONFIG:Debug>:d>.*
|
Qt5Gui$<$<CONFIG:Debug>:d>.*
|
||||||
Qt5Widgets$<$<CONFIG:Debug>:d>.*
|
Qt5Widgets$<$<CONFIG:Debug>:d>.*
|
||||||
Qt5Multimedia$<$<CONFIG:Debug>:d>.*
|
|
||||||
Qt5Network$<$<CONFIG:Debug>:d>.*
|
Qt5Network$<$<CONFIG:Debug>:d>.*
|
||||||
)
|
)
|
||||||
|
if (YUZU_USE_QT_MULTIMEDIA)
|
||||||
|
windows_copy_files(${target_dir} ${Qt5_DLL_DIR} ${DLL_DEST}
|
||||||
|
Qt5Multimedia$<$<CONFIG:Debug>:d>.*
|
||||||
|
)
|
||||||
|
endif()
|
||||||
if (YUZU_USE_QT_WEB_ENGINE)
|
if (YUZU_USE_QT_WEB_ENGINE)
|
||||||
windows_copy_files(${target_dir} ${Qt5_DLL_DIR} ${DLL_DEST}
|
windows_copy_files(${target_dir} ${Qt5_DLL_DIR} ${DLL_DEST}
|
||||||
Qt5Network$<$<CONFIG:Debug>:d>.*
|
Qt5Network$<$<CONFIG:Debug>:d>.*
|
||||||
|
|
|
@ -7,11 +7,6 @@ function(get_timestamp _var)
|
||||||
set(${_var} "${timestamp}" PARENT_SCOPE)
|
set(${_var} "${timestamp}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${SRC_DIR}/externals/cmake-modules")
|
|
||||||
|
|
||||||
# Find the package here with the known path so that the GetGit commands can find it as well
|
|
||||||
find_package(Git QUIET PATHS "${GIT_EXECUTABLE}")
|
|
||||||
|
|
||||||
# generate git/build information
|
# generate git/build information
|
||||||
include(GetGitRevisionDescription)
|
include(GetGitRevisionDescription)
|
||||||
if(NOT GIT_REF_SPEC)
|
if(NOT GIT_REF_SPEC)
|
||||||
|
@ -29,6 +24,7 @@ get_timestamp(BUILD_DATE)
|
||||||
# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well
|
# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well
|
||||||
set(REPO_NAME "")
|
set(REPO_NAME "")
|
||||||
set(BUILD_VERSION "0")
|
set(BUILD_VERSION "0")
|
||||||
|
set(BUILD_ID ${DISPLAY_VERSION})
|
||||||
if (BUILD_REPOSITORY)
|
if (BUILD_REPOSITORY)
|
||||||
# regex capture the string nightly or canary into CMAKE_MATCH_1
|
# regex capture the string nightly or canary into CMAKE_MATCH_1
|
||||||
string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY})
|
string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY})
|
||||||
|
@ -57,6 +53,4 @@ if (BUILD_REPOSITORY)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# The variable SRC_DIR must be passed into the script
|
configure_file(scm_rev.cpp.in scm_rev.cpp @ONLY)
|
||||||
# (since it uses the current build directory for all values of CMAKE_*_DIR)
|
|
||||||
configure_file("${SRC_DIR}/src/common/scm_rev.cpp.in" "scm_rev.cpp" @ONLY)
|
|
||||||
|
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
dist/icons/overlay/button_A.png
vendored
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
dist/icons/overlay/button_B.png
vendored
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
dist/icons/overlay/button_X.png
vendored
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
dist/icons/overlay/button_Y.png
vendored
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
dist/icons/overlay/button_press_stick.png
vendored
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
dist/icons/overlay/controller_dual_joycon.png
vendored
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.4 KiB |
BIN
dist/icons/overlay/controller_dual_joycon_dark.png
vendored
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 3 KiB |
BIN
dist/icons/overlay/controller_handheld.png
vendored
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
dist/icons/overlay/controller_handheld_dark.png
vendored
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 2 KiB |
BIN
dist/icons/overlay/controller_pro.png
vendored
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 4.4 KiB |
BIN
dist/icons/overlay/controller_pro_dark.png
vendored
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 4.4 KiB |
BIN
dist/icons/overlay/controller_single_joycon_left.png
vendored
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
dist/icons/overlay/osk_button_backspace.png
vendored
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
dist/icons/overlay/osk_button_backspace_dark.png
vendored
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.2 KiB |
2
dist/languages/.tx/config
vendored
|
@ -1,7 +1,7 @@
|
||||||
[main]
|
[main]
|
||||||
host = https://www.transifex.com
|
host = https://www.transifex.com
|
||||||
|
|
||||||
[yuzu.emulator]
|
[o:yuzu-emulator:p:yuzu:r:emulator]
|
||||||
file_filter = <lang>.ts
|
file_filter = <lang>.ts
|
||||||
source_file = en.ts
|
source_file = en.ts
|
||||||
source_lang = en
|
source_lang = en
|
||||||
|
|
4
dist/languages/README.md
vendored
|
@ -1 +1,3 @@
|
||||||
This directory stores translation patches (TS files) for yuzu Qt frontend. This directory is linked with [yuzu project on transifex](https://www.transifex.com/yuzu-emulator/yuzu), so you can update the translation by executing `tx pull -a`. If you want to contribute to the translation, please go the transifex link and submit your translation there. This directory on the main repo will be synchronized with transifex periodically. Do not directly open PRs on github to modify the translation.
|
This directory stores translation patches (TS files) for yuzu Qt frontend. This directory is linked with [yuzu project on transifex](https://www.transifex.com/yuzu-emulator/yuzu), so you can update the translation by executing `tx pull -t -a`. If you want to contribute to the translation, please go the transifex link and submit your translation there. This directory on the main repo will be synchronized with transifex periodically.
|
||||||
|
|
||||||
|
Do not directly open PRs on github to modify the translation.
|
||||||
|
|
1852
dist/languages/ca.ts
vendored
1872
dist/languages/cs.ts
vendored
2106
dist/languages/da.ts
vendored
2022
dist/languages/de.ts
vendored
2020
dist/languages/el.ts
vendored
1942
dist/languages/es.ts
vendored
2128
dist/languages/fr.ts
vendored
1883
dist/languages/id.ts
vendored
2149
dist/languages/it.ts
vendored
1894
dist/languages/ja_JP.ts
vendored
2126
dist/languages/ko_KR.ts
vendored
1853
dist/languages/nb.ts
vendored
1945
dist/languages/nl.ts
vendored
1860
dist/languages/pl.ts
vendored
1944
dist/languages/pt_BR.ts
vendored
1944
dist/languages/pt_PT.ts
vendored
2152
dist/languages/ru_RU.ts
vendored
2167
dist/languages/sv.ts
vendored
2201
dist/languages/tr_TR.ts
vendored
7513
dist/languages/uk.ts
vendored
Normal file
1909
dist/languages/vi.ts
vendored
1907
dist/languages/vi_VN.ts
vendored
1858
dist/languages/zh_CN.ts
vendored
1924
dist/languages/zh_TW.ts
vendored
BIN
dist/qt_themes/colorful/icons/48x48/bad_folder.png
vendored
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 528 B |
BIN
dist/qt_themes/default/icons/256x256/plus_folder.png
vendored
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
dist/qt_themes/default/icons/256x256/yuzu.png
vendored
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.9 KiB |
71
externals/CMakeLists.txt
vendored
|
@ -6,19 +6,16 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/externals/find-modules")
|
||||||
include(DownloadExternals)
|
include(DownloadExternals)
|
||||||
|
|
||||||
# xbyak
|
# xbyak
|
||||||
if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64)
|
if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak)
|
||||||
add_library(xbyak INTERFACE)
|
add_subdirectory(xbyak EXCLUDE_FROM_ALL)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/xbyak/include)
|
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/xbyak/xbyak DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/xbyak/include)
|
|
||||||
target_include_directories(xbyak SYSTEM INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/xbyak/include)
|
|
||||||
target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Dynarmic
|
# Dynarmic
|
||||||
if (ARCHITECTURE_x86_64)
|
if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmic)
|
||||||
set(DYNARMIC_NO_BUNDLED_FMT ON)
|
set(DYNARMIC_NO_BUNDLED_FMT ON)
|
||||||
set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE)
|
set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE)
|
||||||
add_subdirectory(dynarmic)
|
add_subdirectory(dynarmic EXCLUDE_FROM_ALL)
|
||||||
|
add_library(dynarmic::dynarmic ALIAS dynarmic)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# getopt
|
# getopt
|
||||||
|
@ -30,7 +27,9 @@ endif()
|
||||||
add_subdirectory(glad)
|
add_subdirectory(glad)
|
||||||
|
|
||||||
# inih
|
# inih
|
||||||
add_subdirectory(inih)
|
if (NOT TARGET inih::INIReader)
|
||||||
|
add_subdirectory(inih)
|
||||||
|
endif()
|
||||||
|
|
||||||
# mbedtls
|
# mbedtls
|
||||||
add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
|
add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
|
||||||
|
@ -46,8 +45,8 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# libusb
|
# libusb
|
||||||
if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB)
|
if (NOT TARGET libusb::usb)
|
||||||
add_subdirectory(libusb)
|
add_subdirectory(libusb EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# SDL2
|
# SDL2
|
||||||
|
@ -68,35 +67,46 @@ if (YUZU_USE_EXTERNAL_SDL2)
|
||||||
endif()
|
endif()
|
||||||
set(SDL_STATIC ON)
|
set(SDL_STATIC ON)
|
||||||
set(SDL_SHARED OFF)
|
set(SDL_SHARED OFF)
|
||||||
|
if (APPLE)
|
||||||
|
set(SDL_FILE ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(SDL EXCLUDE_FROM_ALL)
|
add_subdirectory(SDL EXCLUDE_FROM_ALL)
|
||||||
add_library(SDL2 ALIAS SDL2-static)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ENet
|
# ENet
|
||||||
add_subdirectory(enet)
|
if (NOT TARGET enet::enet)
|
||||||
target_include_directories(enet INTERFACE ./enet/include)
|
add_subdirectory(enet EXCLUDE_FROM_ALL)
|
||||||
|
target_include_directories(enet INTERFACE ./enet/include)
|
||||||
|
add_library(enet::enet ALIAS enet)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Cubeb
|
# Cubeb
|
||||||
if(ENABLE_CUBEB)
|
if (ENABLE_CUBEB AND NOT TARGET cubeb::cubeb)
|
||||||
set(BUILD_TESTS OFF CACHE BOOL "")
|
set(BUILD_TESTS OFF CACHE BOOL "")
|
||||||
add_subdirectory(cubeb EXCLUDE_FROM_ALL)
|
add_subdirectory(cubeb EXCLUDE_FROM_ALL)
|
||||||
|
add_library(cubeb::cubeb ALIAS cubeb)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# DiscordRPC
|
# DiscordRPC
|
||||||
if (USE_DISCORD_PRESENCE)
|
if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc)
|
||||||
add_subdirectory(discord-rpc EXCLUDE_FROM_ALL)
|
add_subdirectory(discord-rpc EXCLUDE_FROM_ALL)
|
||||||
target_include_directories(discord-rpc INTERFACE ./discord-rpc/include)
|
target_include_directories(discord-rpc INTERFACE ./discord-rpc/include)
|
||||||
|
add_library(DiscordRPC::discord-rpc ALIAS discord-rpc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Sirit
|
# Sirit
|
||||||
add_subdirectory(sirit)
|
add_subdirectory(sirit EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
if (ENABLE_WEB_SERVICE)
|
if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib)
|
||||||
find_package(OpenSSL 1.1)
|
if (NOT WIN32)
|
||||||
if (OPENSSL_FOUND)
|
find_package(OpenSSL 1.1)
|
||||||
set(OPENSSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
|
if (OPENSSL_FOUND)
|
||||||
else()
|
set(OPENSSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32 OR NOT OPENSSL_FOUND)
|
||||||
# LibreSSL
|
# LibreSSL
|
||||||
set(LIBRESSL_SKIP_INSTALL ON CACHE BOOL "")
|
set(LIBRESSL_SKIP_INSTALL ON CACHE BOOL "")
|
||||||
set(OPENSSLDIR "/etc/ssl/")
|
set(OPENSSLDIR "/etc/ssl/")
|
||||||
|
@ -116,18 +126,20 @@ if (ENABLE_WEB_SERVICE)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(httplib INTERFACE crypt32 cryptui ws2_32)
|
target_link_libraries(httplib INTERFACE crypt32 cryptui ws2_32)
|
||||||
endif()
|
endif()
|
||||||
|
add_library(httplib::httplib ALIAS httplib)
|
||||||
# cpp-jwt
|
endif()
|
||||||
|
|
||||||
|
# cpp-jwt
|
||||||
|
if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt)
|
||||||
add_library(cpp-jwt INTERFACE)
|
add_library(cpp-jwt INTERFACE)
|
||||||
target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include)
|
target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include)
|
||||||
target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON)
|
target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON)
|
||||||
|
add_library(cpp-jwt::cpp-jwt ALIAS cpp-jwt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Opus
|
# Opus
|
||||||
if (YUZU_USE_BUNDLED_OPUS)
|
if (NOT TARGET Opus::opus)
|
||||||
add_subdirectory(opus EXCLUDE_FROM_ALL)
|
add_subdirectory(opus EXCLUDE_FROM_ALL)
|
||||||
else()
|
|
||||||
find_package(Opus 1.3 REQUIRED)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# FFMpeg
|
# FFMpeg
|
||||||
|
@ -138,3 +150,8 @@ if (YUZU_USE_BUNDLED_FFMPEG)
|
||||||
set(FFmpeg_LIBRARIES "${FFmpeg_LIBRARIES}" PARENT_SCOPE)
|
set(FFmpeg_LIBRARIES "${FFmpeg_LIBRARIES}" PARENT_SCOPE)
|
||||||
set(FFmpeg_INCLUDE_DIR "${FFmpeg_INCLUDE_DIR}" PARENT_SCOPE)
|
set(FFmpeg_INCLUDE_DIR "${FFmpeg_INCLUDE_DIR}" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Vulkan-Headers
|
||||||
|
if (NOT TARGET Vulkan::Headers)
|
||||||
|
add_subdirectory(Vulkan-Headers EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
27
externals/find-modules/FindDiscordRPC.cmake
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
find_path(DiscordRPC_INCLUDE_DIR discord_rpc.h)
|
||||||
|
|
||||||
|
find_library(DiscordRPC_LIBRARY discord-rpc)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(DiscordRPC
|
||||||
|
REQUIRED_VARS
|
||||||
|
DiscordRPC_LIBRARY
|
||||||
|
DiscordRPC_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if (DiscordRPC_FOUND AND NOT TARGET DiscordRPC::discord-rpc)
|
||||||
|
add_library(DiscordRPC::discord-rpc UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(DiscordRPC::discord-rpc PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${DiscordRPC_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${DiscordRPC_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
DiscordRPC_INCLUDE_DIR
|
||||||
|
DiscordRPC_LIBRARY
|
||||||
|
)
|
8
externals/find-modules/FindFFmpeg.cmake
vendored
|
@ -185,3 +185,11 @@ foreach(c ${_FFmpeg_ALL_COMPONENTS})
|
||||||
endforeach()
|
endforeach()
|
||||||
unset(_FFmpeg_ALL_COMPONENTS)
|
unset(_FFmpeg_ALL_COMPONENTS)
|
||||||
unset(_FFmpeg_REQUIRED_VARS)
|
unset(_FFmpeg_REQUIRED_VARS)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(FFmpeg
|
||||||
|
REQUIRED_VARS
|
||||||
|
FFmpeg_LIBRARIES
|
||||||
|
FFmpeg_INCLUDE_DIR
|
||||||
|
HANDLE_COMPONENTS
|
||||||
|
)
|
||||||
|
|
44
externals/find-modules/FindLibUSB.cmake
vendored
|
@ -1,44 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2009 Michal Cihar <michal@cihar.com>
|
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
# - Find libusb-1.0 library
|
|
||||||
# This module defines
|
|
||||||
# LIBUSB_INCLUDE_DIR, where to find bluetooth.h
|
|
||||||
# LIBUSB_LIBRARIES, the libraries needed to use libusb-1.0.
|
|
||||||
# LIBUSB_FOUND, If false, do not try to use libusb-1.0.
|
|
||||||
#
|
|
||||||
# vim: expandtab sw=4 ts=4 sts=4:
|
|
||||||
|
|
||||||
if(ANDROID)
|
|
||||||
set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
|
|
||||||
message(STATUS "libusb-1.0 not found.")
|
|
||||||
elseif (NOT LIBUSB_FOUND)
|
|
||||||
pkg_check_modules (LIBUSB_PKG libusb-1.0)
|
|
||||||
|
|
||||||
find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
|
|
||||||
PATHS
|
|
||||||
${LIBUSB_PKG_INCLUDE_DIRS}
|
|
||||||
/usr/include/libusb-1.0
|
|
||||||
/usr/include
|
|
||||||
/usr/local/include/libusb-1.0
|
|
||||||
/usr/local/include
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(LIBUSB_LIBRARIES NAMES usb-1.0 usb
|
|
||||||
PATHS
|
|
||||||
${LIBUSB_PKG_LIBRARY_DIRS}
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/lib
|
|
||||||
)
|
|
||||||
|
|
||||||
if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
|
|
||||||
set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
|
|
||||||
message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
|
|
||||||
else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
|
|
||||||
set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
|
|
||||||
message(STATUS "libusb-1.0 not found.")
|
|
||||||
endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
|
|
||||||
|
|
||||||
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
|
|
||||||
endif ()
|
|
||||||
|
|
20
externals/find-modules/FindOpus.cmake
vendored
|
@ -1,19 +1,15 @@
|
||||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(OPUS QUIET IMPORTED_TARGET opus)
|
||||||
if (PKG_CONFIG_FOUND)
|
|
||||||
pkg_search_module(opus IMPORTED_TARGET GLOBAL opus)
|
|
||||||
if (opus_FOUND)
|
|
||||||
add_library(Opus::opus ALIAS PkgConfig::opus)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(Opus
|
find_package_handle_standard_args(Opus
|
||||||
REQUIRED_VARS
|
REQUIRED_VARS OPUS_LINK_LIBRARIES
|
||||||
opus_LINK_LIBRARIES
|
VERSION_VAR OPUS_VERSION
|
||||||
opus_FOUND
|
|
||||||
VERSION_VAR opus_VERSION
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (Opus_FOUND AND NOT TARGET Opus::opus)
|
||||||
|
add_library(Opus::opus ALIAS PkgConfig::OPUS)
|
||||||
|
endif()
|
||||||
|
|
16
externals/find-modules/Findenet.cmake
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(ENET QUIET IMPORTED_TARGET libenet)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(enet
|
||||||
|
REQUIRED_VARS ENET_LINK_LIBRARIES
|
||||||
|
VERSION_VAR ENET_VERSION
|
||||||
|
)
|
||||||
|
|
||||||
|
if (enet_FOUND AND NOT TARGET enet::enet)
|
||||||
|
add_library(enet::enet ALIAS PkgConfig::ENET)
|
||||||
|
endif()
|
21
externals/find-modules/Findhttplib.cmake
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
find_package(httplib QUIET CONFIG)
|
||||||
|
if (httplib_FOUND)
|
||||||
|
find_package_handle_standard_args(httplib CONFIG_MODE)
|
||||||
|
else()
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET cpp-httplib)
|
||||||
|
find_package_handle_standard_args(httplib
|
||||||
|
REQUIRED_VARS HTTPLIB_INCLUDEDIR
|
||||||
|
VERSION_VAR HTTPLIB_VERSION
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (httplib_FOUND AND NOT TARGET httplib::httplib)
|
||||||
|
add_library(httplib::httplib ALIAS PkgConfig::HTTPLIB)
|
||||||
|
endif()
|
16
externals/find-modules/Findinih.cmake
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(inih
|
||||||
|
REQUIRED_VARS INIREADER_LINK_LIBRARIES
|
||||||
|
VERSION_VAR INIREADER_VERSION
|
||||||
|
)
|
||||||
|
|
||||||
|
if (inih_FOUND AND NOT TARGET inih::INIReader)
|
||||||
|
add_library(inih::INIReader ALIAS PkgConfig::INIREADER)
|
||||||
|
endif()
|
16
externals/find-modules/Findlibusb.cmake
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(LIBUSB QUIET IMPORTED_TARGET libusb-1.0)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(libusb
|
||||||
|
REQUIRED_VARS LIBUSB_LINK_LIBRARIES
|
||||||
|
VERSION_VAR LIBUSB_VERSION
|
||||||
|
)
|
||||||
|
|
||||||
|
if (libusb_FOUND AND NOT TARGET libusb::usb)
|
||||||
|
add_library(libusb::usb ALIAS PkgConfig::LIBUSB)
|
||||||
|
endif()
|
33
externals/find-modules/Findlz4.cmake
vendored
|
@ -1,19 +1,26 @@
|
||||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
find_package(PkgConfig)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
if (PKG_CONFIG_FOUND)
|
find_package(lz4 QUIET CONFIG)
|
||||||
pkg_search_module(liblz4 IMPORTED_TARGET GLOBAL liblz4)
|
if (lz4_FOUND)
|
||||||
if (liblz4_FOUND)
|
find_package_handle_standard_args(lz4 CONFIG_MODE)
|
||||||
add_library(lz4::lz4 ALIAS PkgConfig::liblz4)
|
else()
|
||||||
endif()
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(LZ4 QUIET IMPORTED_TARGET liblz4)
|
||||||
|
find_package_handle_standard_args(lz4
|
||||||
|
REQUIRED_VARS LZ4_LINK_LIBRARIES
|
||||||
|
VERSION_VAR LZ4_VERSION
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
if (lz4_FOUND AND NOT TARGET lz4::lz4)
|
||||||
find_package_handle_standard_args(lz4
|
if (TARGET LZ4::lz4_shared)
|
||||||
REQUIRED_VARS
|
add_library(lz4::lz4 ALIAS LZ4::lz4_shared)
|
||||||
liblz4_LINK_LIBRARIES
|
elseif (TARGET LZ4::lz4_static)
|
||||||
liblz4_FOUND
|
add_library(lz4::lz4 ALIAS LZ4::lz4_static)
|
||||||
VERSION_VAR liblz4_VERSION
|
else()
|
||||||
)
|
add_library(lz4::lz4 ALIAS PkgConfig::LZ4)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
33
externals/find-modules/Findzstd.cmake
vendored
|
@ -1,19 +1,26 @@
|
||||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
find_package(PkgConfig)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
if (PKG_CONFIG_FOUND)
|
find_package(zstd QUIET CONFIG)
|
||||||
pkg_search_module(libzstd IMPORTED_TARGET GLOBAL libzstd)
|
if (zstd_FOUND)
|
||||||
if (libzstd_FOUND)
|
find_package_handle_standard_args(zstd CONFIG_MODE)
|
||||||
add_library(zstd::zstd ALIAS PkgConfig::libzstd)
|
else()
|
||||||
endif()
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(ZSTD QUIET IMPORTED_TARGET libzstd)
|
||||||
|
find_package_handle_standard_args(zstd
|
||||||
|
REQUIRED_VARS ZSTD_LINK_LIBRARIES
|
||||||
|
VERSION_VAR ZSTD_VERSION
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
if (zstd_FOUND AND NOT TARGET zstd::zstd)
|
||||||
find_package_handle_standard_args(zstd
|
if (TARGET zstd::libzstd_shared)
|
||||||
REQUIRED_VARS
|
add_library(zstd::zstd ALIAS zstd::libzstd_shared)
|
||||||
libzstd_LINK_LIBRARIES
|
elseif (TARGET zstd::libzstd_static)
|
||||||
libzstd_FOUND
|
add_library(zstd::zstd ALIAS zstd::libzstd_static)
|
||||||
VERSION_VAR libzstd_VERSION
|
else()
|
||||||
)
|
add_library(zstd::zstd ALIAS PkgConfig::ZSTD)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
3
externals/inih/CMakeLists.txt
vendored
|
@ -9,4 +9,5 @@ add_library(inih
|
||||||
)
|
)
|
||||||
|
|
||||||
create_target_directory_groups(inih)
|
create_target_directory_groups(inih)
|
||||||
target_include_directories(inih INTERFACE .)
|
target_include_directories(inih INTERFACE inih/cpp)
|
||||||
|
add_library(inih::INIReader ALIAS inih)
|
||||||
|
|
4
externals/libusb/CMakeLists.txt
vendored
|
@ -108,7 +108,7 @@ if (MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR APPLE)
|
||||||
target_include_directories(usb INTERFACE "${LIBUSB_INCLUDE_DIRS}")
|
target_include_directories(usb INTERFACE "${LIBUSB_INCLUDE_DIRS}")
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
Include(FindPkgConfig)
|
find_package(PkgConfig)
|
||||||
pkg_check_modules(LIBUDEV REQUIRED libudev)
|
pkg_check_modules(LIBUDEV REQUIRED libudev)
|
||||||
|
|
||||||
if (LIBUDEV_FOUND)
|
if (LIBUDEV_FOUND)
|
||||||
|
@ -273,3 +273,5 @@ else() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
|
|
||||||
configure_file(config.h.in config.h)
|
configure_file(config.h.in config.h)
|
||||||
endif() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
endif() # MINGW OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
|
|
||||||
|
add_library(libusb::usb ALIAS usb)
|
||||||
|
|
4
externals/microprofile/microprofileui.h
vendored
|
@ -845,8 +845,6 @@ inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int
|
||||||
MicroProfile& S = *MicroProfileGet();
|
MicroProfile& S = *MicroProfileGet();
|
||||||
MP_DEBUG_DUMP_RANGE();
|
MP_DEBUG_DUMP_RANGE();
|
||||||
int nY = nBaseY - UI.nOffsetY;
|
int nY = nBaseY - UI.nOffsetY;
|
||||||
int64_t nNumBoxes = 0;
|
|
||||||
int64_t nNumLines = 0;
|
|
||||||
|
|
||||||
uint32_t nFrameNext = (S.nFrameCurrent+1) % MICROPROFILE_MAX_FRAME_HISTORY;
|
uint32_t nFrameNext = (S.nFrameCurrent+1) % MICROPROFILE_MAX_FRAME_HISTORY;
|
||||||
MicroProfileFrameState* pFrameCurrent = &S.Frames[S.nFrameCurrent];
|
MicroProfileFrameState* pFrameCurrent = &S.Frames[S.nFrameCurrent];
|
||||||
|
@ -1149,7 +1147,6 @@ inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
++nNumBoxes;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1165,7 +1162,6 @@ inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int
|
||||||
}
|
}
|
||||||
nLinesDrawn[nStackPos] = nLineX;
|
nLinesDrawn[nStackPos] = nLineX;
|
||||||
MicroProfileDrawLineVertical(nLineX, fYStart + 0.5f, fYEnd + 0.5f, nColor|UI.nOpacityForeground);
|
MicroProfileDrawLineVertical(nLineX, fYStart + 0.5f, fYEnd + 0.5f, nColor|UI.nOpacityForeground);
|
||||||
++nNumLines;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nStackPos--;
|
nStackPos--;
|
||||||
|
|
|
@ -309,12 +309,16 @@ public:
|
||||||
/// Return a value from a function.
|
/// Return a value from a function.
|
||||||
Id OpReturnValue(Id value);
|
Id OpReturnValue(Id value);
|
||||||
|
|
||||||
/// Fragment-shader discard.
|
/// Deprecated fragment-shader discard.
|
||||||
void OpKill();
|
void OpKill();
|
||||||
|
|
||||||
/// Demote fragment shader invocation to a helper invocation
|
/// Demote fragment shader invocation to a helper invocation
|
||||||
|
void OpDemoteToHelperInvocation();
|
||||||
void OpDemoteToHelperInvocationEXT();
|
void OpDemoteToHelperInvocationEXT();
|
||||||
|
|
||||||
|
/// Fragment-shader discard.
|
||||||
|
void OpTerminateInvocation();
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
|
|
||||||
/// Assign a name string to a reference.
|
/// Assign a name string to a reference.
|
||||||
|
@ -1156,6 +1160,13 @@ public:
|
||||||
/// TBD
|
/// TBD
|
||||||
Id OpSubgroupAllEqualKHR(Id result_type, Id predicate);
|
Id OpSubgroupAllEqualKHR(Id result_type, Id predicate);
|
||||||
|
|
||||||
|
// Result is the Value of the invocation identified by the id Id to all active invocations in
|
||||||
|
// the group.
|
||||||
|
Id OpGroupNonUniformBroadcast(Id result_type, Id scope, Id value, Id id);
|
||||||
|
|
||||||
|
// Result is the Value of the invocation identified by the id Id.
|
||||||
|
Id OpGroupNonUniformShuffle(Id result_type, Id scope, Id value, Id id);
|
||||||
|
|
||||||
/// Return the value of the invocation identified by the current invocation's id within the
|
/// Return the value of the invocation identified by the current invocation's id within the
|
||||||
/// group xor'ed with mask.
|
/// group xor'ed with mask.
|
||||||
Id OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask);
|
Id OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask);
|
||||||
|
|
|
@ -92,9 +92,18 @@ void Module::OpKill() {
|
||||||
*code << spv::Op::OpKill << EndOp{};
|
*code << spv::Op::OpKill << EndOp{};
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::OpDemoteToHelperInvocationEXT() {
|
void Module::OpDemoteToHelperInvocation() {
|
||||||
code->Reserve(1);
|
code->Reserve(1);
|
||||||
*code << spv::Op::OpDemoteToHelperInvocationEXT << EndOp{};
|
*code << spv::Op::OpDemoteToHelperInvocation << EndOp{};
|
||||||
|
}
|
||||||
|
|
||||||
|
void Module::OpDemoteToHelperInvocationEXT() {
|
||||||
|
OpDemoteToHelperInvocation();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Module::OpTerminateInvocation() {
|
||||||
|
code->Reserve(1);
|
||||||
|
*code << spv::Op::OpTerminateInvocation << EndOp{};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Sirit
|
} // namespace Sirit
|
||||||
|
|
|
@ -36,6 +36,18 @@ Id Module::OpSubgroupAllEqualKHR(Id result_type, Id predicate) {
|
||||||
return *code << OpId{spv::Op::OpSubgroupAllEqualKHR, result_type} << predicate << EndOp{};
|
return *code << OpId{spv::Op::OpSubgroupAllEqualKHR, result_type} << predicate << EndOp{};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Id Module::OpGroupNonUniformBroadcast(Id result_type, Id scope, Id value, Id id) {
|
||||||
|
code->Reserve(6);
|
||||||
|
return *code << OpId{spv::Op::OpGroupNonUniformBroadcast, result_type} << scope << value
|
||||||
|
<< id << EndOp{};
|
||||||
|
}
|
||||||
|
|
||||||
|
Id Module::OpGroupNonUniformShuffle(Id result_type, Id scope, Id value, Id id) {
|
||||||
|
code->Reserve(6);
|
||||||
|
return *code << OpId{spv::Op::OpGroupNonUniformShuffle, result_type} << scope << value << id
|
||||||
|
<< EndOp{};
|
||||||
|
}
|
||||||
|
|
||||||
Id Module::OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask) {
|
Id Module::OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask) {
|
||||||
code->Reserve(6);
|
code->Reserve(6);
|
||||||
return *code << OpId{spv::Op::OpGroupNonUniformShuffleXor, result_type} << scope << value
|
return *code << OpId{spv::Op::OpGroupNonUniformShuffleXor, result_type} << scope << value
|
||||||
|
|
|
@ -58,13 +58,11 @@ if (MSVC)
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
/W3
|
/W3
|
||||||
/we4018 # 'expression': signed/unsigned mismatch
|
/WX
|
||||||
|
|
||||||
/we4062 # Enumerator 'identifier' in a switch of enum 'enumeration' is not handled
|
/we4062 # Enumerator 'identifier' in a switch of enum 'enumeration' is not handled
|
||||||
/we4101 # 'identifier': unreferenced local variable
|
|
||||||
/we4189 # 'identifier': local variable is initialized but not referenced
|
/we4189 # 'identifier': local variable is initialized but not referenced
|
||||||
/we4265 # 'class': class has virtual functions, but destructor is not virtual
|
/we4265 # 'class': class has virtual functions, but destructor is not virtual
|
||||||
/we4267 # 'var': conversion from 'size_t' to 'type', possible loss of data
|
|
||||||
/we4305 # 'context': truncation from 'type1' to 'type2'
|
|
||||||
/we4388 # 'expression': signed/unsigned mismatch
|
/we4388 # 'expression': signed/unsigned mismatch
|
||||||
/we4389 # 'operator': signed/unsigned mismatch
|
/we4389 # 'operator': signed/unsigned mismatch
|
||||||
/we4456 # Declaration of 'identifier' hides previous local declaration
|
/we4456 # Declaration of 'identifier' hides previous local declaration
|
||||||
|
@ -75,14 +73,18 @@ if (MSVC)
|
||||||
/we4547 # 'operator': operator before comma has no effect; expected operator with side-effect
|
/we4547 # 'operator': operator before comma has no effect; expected operator with side-effect
|
||||||
/we4549 # 'operator1': operator before comma has no effect; did you intend 'operator2'?
|
/we4549 # 'operator1': operator before comma has no effect; did you intend 'operator2'?
|
||||||
/we4555 # Expression has no effect; expected expression with side-effect
|
/we4555 # Expression has no effect; expected expression with side-effect
|
||||||
/we4715 # 'function': not all control paths return a value
|
/we4826 # Conversion from 'type1' to 'type2' is sign-extended. This may cause unexpected runtime behavior.
|
||||||
/we4834 # Discarding return value of function with 'nodiscard' attribute
|
|
||||||
/we5038 # data member 'member1' will be initialized after data member 'member2'
|
/we5038 # data member 'member1' will be initialized after data member 'member2'
|
||||||
|
/we5233 # explicit lambda capture 'identifier' is not used
|
||||||
/we5245 # 'function': unreferenced function with internal linkage has been removed
|
/we5245 # 'function': unreferenced function with internal linkage has been removed
|
||||||
|
|
||||||
|
/wd4100 # 'identifier': unreferenced formal parameter
|
||||||
|
/wd4324 # 'struct_name': structure was padded due to __declspec(align())
|
||||||
)
|
)
|
||||||
|
|
||||||
if (USE_CCACHE)
|
if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
# when caching, we need to use /Z7 to downgrade debug info to use an older but more cachable format
|
# when caching, we need to use /Z7 to downgrade debug info to use an older but more cachable format
|
||||||
|
# Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21
|
||||||
add_compile_options(/Z7)
|
add_compile_options(/Z7)
|
||||||
else()
|
else()
|
||||||
add_compile_options(/Zi)
|
add_compile_options(/Zi)
|
||||||
|
@ -99,28 +101,25 @@ if (MSVC)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE)
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE)
|
||||||
else()
|
else()
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Wall
|
-Werror=all
|
||||||
-Werror=array-bounds
|
-Werror=extra
|
||||||
-Werror=implicit-fallthrough
|
|
||||||
-Werror=missing-declarations
|
-Werror=missing-declarations
|
||||||
-Werror=missing-field-initializers
|
|
||||||
-Werror=reorder
|
|
||||||
-Werror=shadow
|
-Werror=shadow
|
||||||
-Werror=sign-compare
|
-Werror=unused
|
||||||
-Werror=switch
|
|
||||||
-Werror=uninitialized
|
|
||||||
-Werror=unused-function
|
|
||||||
-Werror=unused-result
|
|
||||||
-Werror=unused-variable
|
|
||||||
-Wextra
|
|
||||||
-Wmissing-declarations
|
|
||||||
-Wno-attributes
|
-Wno-attributes
|
||||||
-Wno-invalid-offsetof
|
-Wno-invalid-offsetof
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
|
|
||||||
|
$<$<CXX_COMPILER_ID:Clang>:-Wno-braced-scalar-init>
|
||||||
|
$<$<CXX_COMPILER_ID:Clang>:-Wno-unused-private-field>
|
||||||
|
$<$<CXX_COMPILER_ID:AppleClang>:-Wno-braced-scalar-init>
|
||||||
|
$<$<CXX_COMPILER_ID:AppleClang>:-Wno-unused-private-field>
|
||||||
)
|
)
|
||||||
|
|
||||||
if (ARCHITECTURE_x86_64)
|
if (ARCHITECTURE_x86_64)
|
||||||
add_compile_options("-mcx16")
|
add_compile_options("-mcx16")
|
||||||
|
add_compile_options("-fwrapv")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||||
|
|
|
@ -31,6 +31,7 @@ add_library(audio_core STATIC
|
||||||
out/audio_out.h
|
out/audio_out.h
|
||||||
out/audio_out_system.cpp
|
out/audio_out_system.cpp
|
||||||
out/audio_out_system.h
|
out/audio_out_system.h
|
||||||
|
precompiled_headers.h
|
||||||
renderer/adsp/adsp.cpp
|
renderer/adsp/adsp.cpp
|
||||||
renderer/adsp/adsp.h
|
renderer/adsp/adsp.h
|
||||||
renderer/adsp/audio_renderer.cpp
|
renderer/adsp/audio_renderer.cpp
|
||||||
|
@ -206,35 +207,30 @@ if (MSVC)
|
||||||
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
|
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
|
||||||
/we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch
|
/we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch
|
||||||
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
||||||
/we4456 # Declaration of 'identifier' hides previous local declaration
|
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
|
||||||
/we4457 # Declaration of 'identifier' hides function parameter
|
|
||||||
/we4458 # Declaration of 'identifier' hides class member
|
|
||||||
/we4459 # Declaration of 'identifier' hides global declaration
|
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
target_compile_options(audio_core PRIVATE
|
target_compile_options(audio_core PRIVATE
|
||||||
-Werror=conversion
|
-Werror=conversion
|
||||||
-Werror=ignored-qualifiers
|
|
||||||
-Werror=shadow
|
|
||||||
-Werror=unused-variable
|
|
||||||
|
|
||||||
$<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
|
|
||||||
$<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
|
|
||||||
|
|
||||||
-Wno-sign-conversion
|
-Wno-sign-conversion
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(audio_core PUBLIC common core)
|
target_link_libraries(audio_core PUBLIC common core)
|
||||||
if (ARCHITECTURE_x86_64)
|
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
|
||||||
target_link_libraries(audio_core PRIVATE dynarmic)
|
target_link_libraries(audio_core PRIVATE dynarmic::dynarmic)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CUBEB)
|
if(ENABLE_CUBEB)
|
||||||
target_link_libraries(audio_core PRIVATE cubeb)
|
target_link_libraries(audio_core PRIVATE cubeb::cubeb)
|
||||||
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
|
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
|
||||||
endif()
|
endif()
|
||||||
if(ENABLE_SDL2)
|
if(ENABLE_SDL2)
|
||||||
target_link_libraries(audio_core PRIVATE SDL2)
|
target_link_libraries(audio_core PRIVATE SDL2::SDL2)
|
||||||
target_compile_definitions(audio_core PRIVATE HAVE_SDL2)
|
target_compile_definitions(audio_core PRIVATE HAVE_SDL2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
|
target_precompile_headers(audio_core PRIVATE precompiled_headers.h)
|
||||||
|
endif()
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
namespace AudioCore {
|
namespace AudioCore {
|
||||||
|
|
||||||
AudioCore::AudioCore(Core::System& system) : audio_manager{std::make_unique<AudioManager>(system)} {
|
AudioCore::AudioCore(Core::System& system) : audio_manager{std::make_unique<AudioManager>()} {
|
||||||
CreateSinks();
|
CreateSinks();
|
||||||
// Must be created after the sinks
|
// Must be created after the sinks
|
||||||
adsp = std::make_unique<AudioRenderer::ADSP::ADSP>(system, *output_sink);
|
adsp = std::make_unique<AudioRenderer::ADSP::ADSP>(system, *output_sink);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "audio_core/audio_event.h"
|
#include "audio_core/audio_event.h"
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
|
#include "common/polyfill_ranges.h"
|
||||||
|
|
||||||
namespace AudioCore {
|
namespace AudioCore {
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "audio_core/audio_in_manager.h"
|
|
||||||
#include "audio_core/audio_manager.h"
|
#include "audio_core/audio_manager.h"
|
||||||
#include "audio_core/audio_out_manager.h"
|
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
|
#include "core/hle/service/audio/errors.h"
|
||||||
|
|
||||||
namespace AudioCore {
|
namespace AudioCore {
|
||||||
|
|
||||||
AudioManager::AudioManager(Core::System& system_) : system{system_} {
|
AudioManager::AudioManager() {
|
||||||
thread = std::jthread([this]() { ThreadFunc(); });
|
thread = std::jthread([this]() { ThreadFunc(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +26,7 @@ Result AudioManager::SetOutManager(BufferEventFunc buffer_func) {
|
||||||
|
|
||||||
const auto index{events.GetManagerIndex(Event::Type::AudioOutManager)};
|
const auto index{events.GetManagerIndex(Event::Type::AudioOutManager)};
|
||||||
if (buffer_events[index] == nullptr) {
|
if (buffer_events[index] == nullptr) {
|
||||||
buffer_events[index] = buffer_func;
|
buffer_events[index] = std::move(buffer_func);
|
||||||
needs_update = true;
|
needs_update = true;
|
||||||
events.SetAudioEvent(Event::Type::AudioOutManager, true);
|
events.SetAudioEvent(Event::Type::AudioOutManager, true);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +42,7 @@ Result AudioManager::SetInManager(BufferEventFunc buffer_func) {
|
||||||
|
|
||||||
const auto index{events.GetManagerIndex(Event::Type::AudioInManager)};
|
const auto index{events.GetManagerIndex(Event::Type::AudioInManager)};
|
||||||
if (buffer_events[index] == nullptr) {
|
if (buffer_events[index] == nullptr) {
|
||||||
buffer_events[index] = buffer_func;
|
buffer_events[index] = std::move(buffer_func);
|
||||||
needs_update = true;
|
needs_update = true;
|
||||||
events.SetAudioEvent(Event::Type::AudioInManager, true);
|
events.SetAudioEvent(Event::Type::AudioInManager, true);
|
||||||
}
|
}
|
||||||
|
@ -60,19 +59,21 @@ void AudioManager::ThreadFunc() {
|
||||||
running = true;
|
running = true;
|
||||||
|
|
||||||
while (running) {
|
while (running) {
|
||||||
auto timed_out{events.Wait(l, std::chrono::seconds(2))};
|
const auto timed_out{events.Wait(l, std::chrono::seconds(2))};
|
||||||
|
|
||||||
if (events.CheckAudioEventSet(Event::Type::Max)) {
|
if (events.CheckAudioEventSet(Event::Type::Max)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < buffer_events.size(); i++) {
|
for (size_t i = 0; i < buffer_events.size(); i++) {
|
||||||
if (events.CheckAudioEventSet(Event::Type(i)) || timed_out) {
|
const auto event_type = static_cast<Event::Type>(i);
|
||||||
|
|
||||||
|
if (events.CheckAudioEventSet(event_type) || timed_out) {
|
||||||
if (buffer_events[i]) {
|
if (buffer_events[i]) {
|
||||||
buffer_events[i]();
|
buffer_events[i]();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
events.SetAudioEvent(Event::Type(i), false);
|
events.SetAudioEvent(event_type, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,23 +9,14 @@
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include "audio_core/audio_event.h"
|
#include "common/polyfill_thread.h"
|
||||||
#include "core/hle/service/audio/errors.h"
|
|
||||||
|
|
||||||
namespace Core {
|
#include "audio_core/audio_event.h"
|
||||||
class System;
|
|
||||||
}
|
union Result;
|
||||||
|
|
||||||
namespace AudioCore {
|
namespace AudioCore {
|
||||||
|
|
||||||
namespace AudioOut {
|
|
||||||
class Manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace AudioIn {
|
|
||||||
class Manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The AudioManager's main purpose is to wait for buffer events for the audio in and out managers,
|
* The AudioManager's main purpose is to wait for buffer events for the audio in and out managers,
|
||||||
* and call an associated callback to release buffers.
|
* and call an associated callback to release buffers.
|
||||||
|
@ -43,7 +34,7 @@ class AudioManager {
|
||||||
using BufferEventFunc = std::function<void()>;
|
using BufferEventFunc = std::function<void()>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AudioManager(Core::System& system);
|
explicit AudioManager();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shutdown the audio manager.
|
* Shutdown the audio manager.
|
||||||
|
@ -80,10 +71,6 @@ private:
|
||||||
*/
|
*/
|
||||||
void ThreadFunc();
|
void ThreadFunc();
|
||||||
|
|
||||||
/// Core system
|
|
||||||
Core::System& system;
|
|
||||||
/// Have sessions started palying?
|
|
||||||
bool sessions_started{};
|
|
||||||
/// Is the main thread running?
|
/// Is the main thread running?
|
||||||
std::atomic<bool> running{};
|
std::atomic<bool> running{};
|
||||||
/// Unused
|
/// Unused
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "common/polyfill_thread.h"
|
||||||
|
|
||||||
#include "audio_core/common/common.h"
|
#include "audio_core/common/common.h"
|
||||||
#include "audio_core/renderer/system_manager.h"
|
#include "audio_core/renderer/system_manager.h"
|
||||||
#include "core/hle/service/audio/errors.h"
|
#include "core/hle/service/audio/errors.h"
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
#include "common/polyfill_ranges.h"
|
||||||
|
|
||||||
namespace AudioCore {
|
namespace AudioCore {
|
||||||
constexpr u32 CurrentRevision = 11;
|
constexpr u32 CurrentRevision = 11;
|
||||||
|
|
|
@ -91,9 +91,10 @@ public:
|
||||||
* @param core_timing - The CoreTiming instance
|
* @param core_timing - The CoreTiming instance
|
||||||
* @param session - The device session
|
* @param session - The device session
|
||||||
*
|
*
|
||||||
* @return Is the buffer was released.
|
* @return If any buffer was released.
|
||||||
*/
|
*/
|
||||||
bool ReleaseBuffers(const Core::Timing::CoreTiming& core_timing, const DeviceSession& session) {
|
bool ReleaseBuffers(const Core::Timing::CoreTiming& core_timing, const DeviceSession& session,
|
||||||
|
bool force) {
|
||||||
std::scoped_lock l{lock};
|
std::scoped_lock l{lock};
|
||||||
bool buffer_released{false};
|
bool buffer_released{false};
|
||||||
while (registered_count > 0) {
|
while (registered_count > 0) {
|
||||||
|
@ -103,7 +104,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check with the backend if this buffer can be released yet.
|
// Check with the backend if this buffer can be released yet.
|
||||||
if (!session.IsBufferConsumed(buffers[index])) {
|
// If we're shutting down, we don't care if it's been played or not.
|
||||||
|
if (!force && !session.IsBufferConsumed(buffers[index])) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,12 @@ void DeviceSession::Stop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceSession::ClearBuffers() {
|
||||||
|
if (stream) {
|
||||||
|
stream->ClearQueue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) const {
|
void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) const {
|
||||||
for (const auto& buffer : buffers) {
|
for (const auto& buffer : buffers) {
|
||||||
Sink::SinkBuffer new_buffer{
|
Sink::SinkBuffer new_buffer{
|
||||||
|
|
|
@ -90,6 +90,11 @@ public:
|
||||||
*/
|
*/
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear out the underlying audio buffers in the backend stream.
|
||||||
|
*/
|
||||||
|
void ClearBuffers();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this device session's volume.
|
* Set this device session's volume.
|
||||||
*
|
*
|
||||||
|
|
|
@ -23,7 +23,6 @@ System::~System() {
|
||||||
void System::Finalize() {
|
void System::Finalize() {
|
||||||
Stop();
|
Stop();
|
||||||
session->Finalize();
|
session->Finalize();
|
||||||
buffer_event->GetWritableEvent().Signal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void System::StartSession() {
|
void System::StartSession() {
|
||||||
|
@ -56,7 +55,7 @@ Result System::IsConfigValid(const std::string_view device_name,
|
||||||
return ResultSuccess;
|
return ResultSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result System::Initialize(std::string& device_name, const AudioInParameter& in_params,
|
Result System::Initialize(std::string device_name, const AudioInParameter& in_params,
|
||||||
const u32 handle_, const u64 applet_resource_user_id_) {
|
const u32 handle_, const u64 applet_resource_user_id_) {
|
||||||
auto result{IsConfigValid(device_name, in_params)};
|
auto result{IsConfigValid(device_name, in_params)};
|
||||||
if (result.IsError()) {
|
if (result.IsError()) {
|
||||||
|
@ -102,6 +101,10 @@ Result System::Stop() {
|
||||||
if (state == State::Started) {
|
if (state == State::Started) {
|
||||||
session->Stop();
|
session->Stop();
|
||||||
session->SetVolume(0.0f);
|
session->SetVolume(0.0f);
|
||||||
|
session->ClearBuffers();
|
||||||
|
if (buffers.ReleaseBuffers(system.CoreTiming(), *session, true)) {
|
||||||
|
buffer_event->Signal();
|
||||||
|
}
|
||||||
state = State::Stopped;
|
state = State::Stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,11 +141,11 @@ void System::RegisterBuffers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void System::ReleaseBuffers() {
|
void System::ReleaseBuffers() {
|
||||||
bool signal{buffers.ReleaseBuffers(system.CoreTiming(), *session)};
|
bool signal{buffers.ReleaseBuffers(system.CoreTiming(), *session, false)};
|
||||||
|
|
||||||
if (signal) {
|
if (signal) {
|
||||||
// Signal if any buffer was released, or if none are registered, we need more.
|
// Signal if any buffer was released, or if none are registered, we need more.
|
||||||
buffer_event->GetWritableEvent().Signal();
|
buffer_event->Signal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +162,7 @@ bool System::FlushAudioInBuffers() {
|
||||||
buffers.FlushBuffers(buffers_released);
|
buffers.FlushBuffers(buffers_released);
|
||||||
|
|
||||||
if (buffers_released > 0) {
|
if (buffers_released > 0) {
|
||||||
buffer_event->GetWritableEvent().Signal();
|
buffer_event->Signal();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
* @param applet_resource_user_id - Unused.
|
* @param applet_resource_user_id - Unused.
|
||||||
* @return Result code.
|
* @return Result code.
|
||||||
*/
|
*/
|
||||||
Result Initialize(std::string& device_name, const AudioInParameter& in_params, u32 handle,
|
Result Initialize(std::string device_name, const AudioInParameter& in_params, u32 handle,
|
||||||
u64 applet_resource_user_id);
|
u64 applet_resource_user_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,7 +24,6 @@ System::~System() {
|
||||||
void System::Finalize() {
|
void System::Finalize() {
|
||||||
Stop();
|
Stop();
|
||||||
session->Finalize();
|
session->Finalize();
|
||||||
buffer_event->GetWritableEvent().Signal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view System::GetDefaultOutputDeviceName() const {
|
std::string_view System::GetDefaultOutputDeviceName() const {
|
||||||
|
@ -49,8 +48,8 @@ Result System::IsConfigValid(std::string_view device_name,
|
||||||
return Service::Audio::ERR_INVALID_CHANNEL_COUNT;
|
return Service::Audio::ERR_INVALID_CHANNEL_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result System::Initialize(std::string& device_name, const AudioOutParameter& in_params, u32 handle_,
|
Result System::Initialize(std::string device_name, const AudioOutParameter& in_params, u32 handle_,
|
||||||
u64& applet_resource_user_id_) {
|
u64 applet_resource_user_id_) {
|
||||||
auto result = IsConfigValid(device_name, in_params);
|
auto result = IsConfigValid(device_name, in_params);
|
||||||
if (result.IsError()) {
|
if (result.IsError()) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -102,6 +101,10 @@ Result System::Stop() {
|
||||||
if (state == State::Started) {
|
if (state == State::Started) {
|
||||||
session->Stop();
|
session->Stop();
|
||||||
session->SetVolume(0.0f);
|
session->SetVolume(0.0f);
|
||||||
|
session->ClearBuffers();
|
||||||
|
if (buffers.ReleaseBuffers(system.CoreTiming(), *session, true)) {
|
||||||
|
buffer_event->Signal();
|
||||||
|
}
|
||||||
state = State::Stopped;
|
state = State::Stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,10 +141,10 @@ void System::RegisterBuffers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void System::ReleaseBuffers() {
|
void System::ReleaseBuffers() {
|
||||||
bool signal{buffers.ReleaseBuffers(system.CoreTiming(), *session)};
|
bool signal{buffers.ReleaseBuffers(system.CoreTiming(), *session, false)};
|
||||||
if (signal) {
|
if (signal) {
|
||||||
// Signal if any buffer was released, or if none are registered, we need more.
|
// Signal if any buffer was released, or if none are registered, we need more.
|
||||||
buffer_event->GetWritableEvent().Signal();
|
buffer_event->Signal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +161,7 @@ bool System::FlushAudioOutBuffers() {
|
||||||
buffers.FlushBuffers(buffers_released);
|
buffers.FlushBuffers(buffers_released);
|
||||||
|
|
||||||
if (buffers_released > 0) {
|
if (buffers_released > 0) {
|
||||||
buffer_event->GetWritableEvent().Signal();
|
buffer_event->Signal();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,8 +88,8 @@ public:
|
||||||
* @param applet_resource_user_id - Unused.
|
* @param applet_resource_user_id - Unused.
|
||||||
* @return Result code.
|
* @return Result code.
|
||||||
*/
|
*/
|
||||||
Result Initialize(std::string& device_name, const AudioOutParameter& in_params, u32 handle,
|
Result Initialize(std::string device_name, const AudioOutParameter& in_params, u32 handle,
|
||||||
u64& applet_resource_user_id);
|
u64 applet_resource_user_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start this system.
|
* Start this system.
|
||||||
|
|
6
src/audio_core/precompiled_headers.h
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "common/common_precompiled_headers.h"
|
|
@ -47,7 +47,7 @@ RenderMessage AudioRenderer_Mailbox::ADSPWaitMessage() {
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandBuffer& AudioRenderer_Mailbox::GetCommandBuffer(const s32 session_id) {
|
CommandBuffer& AudioRenderer_Mailbox::GetCommandBuffer(const u32 session_id) {
|
||||||
return command_buffers[session_id];
|
return command_buffers[session_id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ void AudioRenderer::CreateSinkStreams() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioRenderer::ThreadFunc() {
|
void AudioRenderer::ThreadFunc() {
|
||||||
constexpr char name[]{"yuzu:AudioRenderer"};
|
constexpr char name[]{"AudioRenderer"};
|
||||||
MicroProfileOnThreadCreate(name);
|
MicroProfileOnThreadCreate(name);
|
||||||
Common::SetCurrentThreadName(name);
|
Common::SetCurrentThreadName(name);
|
||||||
Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical);
|
Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical);
|
||||||
|
|
|
@ -83,7 +83,7 @@ public:
|
||||||
* @param session_id - The session id to get (0 or 1).
|
* @param session_id - The session id to get (0 or 1).
|
||||||
* @return The command buffer.
|
* @return The command buffer.
|
||||||
*/
|
*/
|
||||||
CommandBuffer& GetCommandBuffer(s32 session_id);
|
CommandBuffer& GetCommandBuffer(u32 session_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the command buffer with the given session id (0 or 1).
|
* Set the command buffer with the given session id (0 or 1).
|
||||||
|
|