summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.ci/scripts/clang/docker.sh12
-rwxr-xr-x.ci/scripts/windows/docker.sh5
-rw-r--r--.ci/templates/build-msvc.yml4
-rw-r--r--.github/workflows/verify.yml3
-rw-r--r--.gitmodules7
-rw-r--r--CMakeLists.txt170
m---------externals/SDL0
m---------externals/dynarmic0
m---------externals/vcpkg0
-rw-r--r--src/common/CMakeLists.txt5
-rw-r--r--src/core/hle/service/am/am.cpp4
-rw-r--r--src/core/hle/service/am/am.h1
-rw-r--r--src/core/hle/service/sockets/bsd.cpp20
-rw-r--r--src/yuzu/configuration/configure_input.ui2
-rw-r--r--src/yuzu/main.cpp17
-rw-r--r--src/yuzu/main.h1
-rw-r--r--vcpkg.json29
17 files changed, 122 insertions, 158 deletions
diff --git a/.ci/scripts/clang/docker.sh b/.ci/scripts/clang/docker.sh
index 94a9ca0ec..db736f72b 100755
--- a/.ci/scripts/clang/docker.sh
+++ b/.ci/scripts/clang/docker.sh
@@ -6,7 +6,17 @@ set -e
6ccache -s 6ccache -s
7 7
8mkdir build || true && cd build 8mkdir build || true && cd build
9cmake .. -GNinja -DDISPLAY_VERSION=$1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/clang -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_INSTALL_PREFIX="/usr" 9cmake .. \
10 -DCMAKE_BUILD_TYPE=Release \
11 -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \
12 -DCMAKE_C_COMPILER=/usr/lib/ccache/clang \
13 -DCMAKE_INSTALL_PREFIX="/usr" \
14 -DDISPLAY_VERSION=$1 \
15 -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
16 -DENABLE_QT_TRANSLATION=ON \
17 -DUSE_DISCORD_PRESENCE=ON \
18 -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
19 -GNinja
10 20
11ninja 21ninja
12 22
diff --git a/.ci/scripts/windows/docker.sh b/.ci/scripts/windows/docker.sh
index 5bd5f0b6b..9f34530d6 100755
--- a/.ci/scripts/windows/docker.sh
+++ b/.ci/scripts/windows/docker.sh
@@ -6,10 +6,6 @@ set -e
6 6
7ccache -sv 7ccache -sv
8 8
9mkdir -p "$HOME/.conan/profiles"
10wget -c "https://github.com/yuzu-emu/build-environments/raw/master/linux-mingw/default" -O "$HOME/.conan/profiles/default"
11wget -c "https://github.com/yuzu-emu/build-environments/raw/master/linux-mingw/settings.yml" -O "$HOME/.conan/settings.yml"
12
13mkdir -p build && cd build 9mkdir -p build && cd build
14export LDFLAGS="-fuse-ld=lld" 10export LDFLAGS="-fuse-ld=lld"
15# -femulated-tls required due to an incompatibility between GCC and Clang 11# -femulated-tls required due to an incompatibility between GCC and Clang
@@ -24,6 +20,7 @@ cmake .. \
24 -DUSE_CCACHE=ON \ 20 -DUSE_CCACHE=ON \
25 -DYUZU_USE_BUNDLED_SDL2=OFF \ 21 -DYUZU_USE_BUNDLED_SDL2=OFF \
26 -DYUZU_USE_EXTERNAL_SDL2=OFF \ 22 -DYUZU_USE_EXTERNAL_SDL2=OFF \
23 -DYUZU_TESTS=OFF \
27 -GNinja 24 -GNinja
28ninja yuzu yuzu-cmd 25ninja yuzu yuzu-cmd
29 26
diff --git a/.ci/templates/build-msvc.yml b/.ci/templates/build-msvc.yml
index cca3189fa..5d2e86179 100644
--- a/.ci/templates/build-msvc.yml
+++ b/.ci/templates/build-msvc.yml
@@ -6,9 +6,7 @@ parameters:
6steps: 6steps:
7- script: choco install vulkan-sdk 7- script: choco install vulkan-sdk
8 displayName: 'Install vulkan-sdk' 8 displayName: 'Install vulkan-sdk'
9- script: python -m pip install --upgrade pip conan 9- 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_TESTS=OFF -DYUZU_USE_BUNDLED_VCPKG=ON .. && cd ..
10 displayName: 'Install conan'
11- 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 .. && cd ..
12 displayName: 'Configure CMake' 10 displayName: 'Configure CMake'
13- task: MSBuild@1 11- task: MSBuild@1
14 displayName: 'Build' 12 displayName: 'Build'
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index c1886b9f3..88e3a9a72 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -80,7 +80,6 @@ jobs:
80 shell: cmd 80 shell: cmd
81 run: | 81 run: |
82 choco install vulkan-sdk wget 82 choco install vulkan-sdk wget
83 python -m pip install --upgrade pip conan
84 call refreshenv 83 call refreshenv
85 wget https://github.com/mbitsnbites/buildcache/releases/download/v0.27.6/buildcache-windows.zip 84 wget https://github.com/mbitsnbites/buildcache/releases/download/v0.27.6/buildcache-windows.zip
86 7z x buildcache-windows.zip 85 7z x buildcache-windows.zip
@@ -100,7 +99,7 @@ jobs:
100 run: | 99 run: |
101 glslangValidator --version 100 glslangValidator --version
102 mkdir build 101 mkdir build
103 cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -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=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release 102 cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -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=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_VCPKG=ON
104 - name: Build 103 - name: Build
105 run: cmake --build build 104 run: cmake --build build
106 - name: Cache Summary 105 - name: Cache Summary
diff --git a/.gitmodules b/.gitmodules
index dc92d0a4b..76f13164c 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -34,9 +34,12 @@
34[submodule "SDL"] 34[submodule "SDL"]
35 path = externals/SDL 35 path = externals/SDL
36 url = https://github.com/libsdl-org/SDL.git 36 url = https://github.com/libsdl-org/SDL.git
37[submodule "externals/cpp-httplib"] 37[submodule "cpp-httplib"]
38 path = externals/cpp-httplib 38 path = externals/cpp-httplib
39 url = https://github.com/yhirose/cpp-httplib.git 39 url = https://github.com/yhirose/cpp-httplib.git
40[submodule "externals/ffmpeg/ffmpeg"] 40[submodule "ffmpeg"]
41 path = externals/ffmpeg/ffmpeg 41 path = externals/ffmpeg/ffmpeg
42 url = https://git.ffmpeg.org/ffmpeg.git 42 url = https://git.ffmpeg.org/ffmpeg.git
43[submodule "vcpkg"]
44 path = externals/vcpkg
45 url = https://github.com/Microsoft/vcpkg.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80a8d4ed8..6993b6967 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,16 @@ option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON)
35 35
36option(YUZU_TESTS "Compile tests" ON) 36option(YUZU_TESTS "Compile tests" ON)
37 37
38option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" OFF)
39
40if (YUZU_USE_BUNDLED_VCPKG)
41 include(${CMAKE_SOURCE_DIR}/externals/vcpkg/scripts/buildsystems/vcpkg.cmake)
42elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "")
43 # Disable manifest mode (use vcpkg classic mode) when using a custom vcpkg installation
44 option(VCPKG_MANIFEST_MODE "")
45 include("$ENV{VCPKG_TOOLCHAIN_FILE}")
46endif()
47
38# Default to a Release build 48# Default to a Release build
39get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 49get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
40if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) 50if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE)
@@ -144,82 +154,34 @@ endif()
144set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) 154set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
145 155
146# System imported libraries 156# System imported libraries
147# If not found, download any missing through Conan
148# ======================================================================= 157# =======================================================================
149set(CONAN_CMAKE_SILENT_OUTPUT TRUE)
150set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
151if (YUZU_CONAN_INSTALLED)
152 if (IS_MULTI_CONFIG)
153 include(${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake)
154 else()
155 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
156 endif()
157 list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}")
158 list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")
159 conan_basic_setup()
160 message(STATUS "Adding conan installed libraries to the search path")
161endif()
162 158
163macro(yuzu_find_packages) 159find_package(fmt 8.0.1 REQUIRED CONFIG)
164 set(options FORCE_REQUIRED) 160find_package(lz4 1.8 REQUIRED)
165 cmake_parse_arguments(FN "${options}" "" "" ${ARGN}) 161find_package(nlohmann_json 3.8 REQUIRED CONFIG)
166 162find_package(ZLIB 1.2 REQUIRED)
167 # Cmake has a *serious* lack of 2D array or associative array...
168 # Capitalization matters here. We need the naming to match the generated paths from Conan
169 set(REQUIRED_LIBS
170 # Cmake Pkg Prefix Version Conan Pkg
171 "fmt 8.0.1 fmt/8.1.1"
172 "lz4 1.8 lz4/1.9.2"
173 "nlohmann_json 3.8 nlohmann_json/3.8.0"
174 "ZLIB 1.2 zlib/1.2.11"
175 "zstd 1.5 zstd/1.5.0"
176 # can't use opus until AVX check is fixed: https://github.com/yuzu-emu/yuzu/pull/4068
177 #"opus 1.3 opus/1.3.1"
178 )
179 if (YUZU_TESTS)
180 list(APPEND REQUIRED_LIBS
181 "Catch2 2.13.7 catch2/2.13.7"
182 )
183 endif()
184 163
185 foreach(PACKAGE ${REQUIRED_LIBS}) 164# Search for config-only package first (for vcpkg), then try non-config
186 string(REGEX REPLACE "[ \t\r\n]+" ";" PACKAGE_SPLIT ${PACKAGE}) 165find_package(zstd 1.5 CONFIG)
187 list(GET PACKAGE_SPLIT 0 PACKAGE_PREFIX) 166if (NOT zstd_FOUND)
188 list(GET PACKAGE_SPLIT 1 PACKAGE_VERSION) 167 find_package(zstd 1.5 REQUIRED)
189 list(GET PACKAGE_SPLIT 2 PACKAGE_CONAN) 168endif()
190 # This function is called twice, once to check if the packages exist on the system already 169
191 # and a second time to check if conan installed them properly. The second check passes in FORCE_REQUIRED 170if (YUZU_TESTS)
192 if (NOT ${PACKAGE_PREFIX}_FOUND) 171 find_package(Catch2 2.13.7 REQUIRED CONFIG)
193 if (FN_FORCE_REQUIRED) 172endif()
194 find_package(${PACKAGE_PREFIX} ${PACKAGE_VERSION} REQUIRED)
195 else()
196 find_package(${PACKAGE_PREFIX} ${PACKAGE_VERSION})
197 endif()
198 endif()
199 if (NOT ${PACKAGE_PREFIX}_FOUND)
200 list(APPEND CONAN_REQUIRED_LIBS ${PACKAGE_CONAN})
201 else()
202 # Set a legacy findPackage.cmake style PACKAGE_LIBRARIES variable for subprojects that rely on this
203 set(${PACKAGE_PREFIX}_LIBRARIES "${PACKAGE_PREFIX}::${PACKAGE_PREFIX}")
204 endif()
205 endforeach()
206 unset(FN_FORCE_REQUIRED)
207endmacro()
208 173
209find_package(Boost 1.73.0 COMPONENTS context headers) 174find_package(Boost 1.73.0 COMPONENTS context)
210if (Boost_FOUND) 175if (Boost_FOUND)
211 set(Boost_LIBRARIES Boost::boost) 176 set(Boost_LIBRARIES Boost::boost)
212 # Conditionally add Boost::context only if the active version of the Conan or system Boost package provides it 177 # Conditionally add Boost::context only if the found Boost package provides it
213 # The old version is missing Boost::context, so we want to avoid adding in that case 178 # The old version is missing Boost::context, so we want to avoid adding in that case
214 # The new version requires adding Boost::context to prevent linking issues 179 # The new version requires adding Boost::context to prevent linking issues
215 #
216 # This one is used by Conan on subsequent CMake configures, not the first configure.
217 if (TARGET Boost::context) 180 if (TARGET Boost::context)
218 list(APPEND Boost_LIBRARIES Boost::context) 181 list(APPEND Boost_LIBRARIES Boost::context)
219 endif() 182 endif()
220else() 183else()
221 message(STATUS "Boost 1.79.0 or newer not found, falling back to Conan") 184 message(FATAL_ERROR "Boost 1.73.0 or newer not found")
222 list(APPEND CONAN_REQUIRED_LIBS "boost/1.79.0")
223endif() 185endif()
224 186
225# boost:asio has functions that require AcceptEx et al 187# boost:asio has functions that require AcceptEx et al
@@ -227,19 +189,9 @@ if (MINGW)
227 find_library(MSWSOCK_LIBRARY mswsock REQUIRED) 189 find_library(MSWSOCK_LIBRARY mswsock REQUIRED)
228endif() 190endif()
229 191
230# Attempt to locate any packages that are required and report the missing ones in CONAN_REQUIRED_LIBS
231yuzu_find_packages()
232
233# Qt5 requires that we find components, so it doesn't fit our pretty little find package function 192# Qt5 requires that we find components, so it doesn't fit our pretty little find package function
234if(ENABLE_QT) 193if(ENABLE_QT)
235 set(QT_VERSION 5.15) 194 set(QT_VERSION 5.15)
236 # We want to load the generated conan qt config so that we get the QT_ROOT var so that we can use the official
237 # Qt5Config inside the root folder instead of the conan generated one.
238 if(EXISTS ${CMAKE_BINARY_DIR}/qtConfig.cmake)
239 include(${CMAKE_BINARY_DIR}/qtConfig.cmake)
240 list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}")
241 list(APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}")
242 endif()
243 195
244 # Check for system Qt on Linux, fallback to bundled Qt 196 # Check for system Qt on Linux, fallback to bundled Qt
245 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 197 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
@@ -330,9 +282,6 @@ if(ENABLE_QT)
330 282
331 set(YUZU_QT_NO_CMAKE_SYSTEM_PATH) 283 set(YUZU_QT_NO_CMAKE_SYSTEM_PATH)
332 284
333 # Workaround for an issue where conan tries to build Qt from scratch instead of download prebuilt binaries
334 set(QT_PREFIX_HINT)
335
336 if(YUZU_USE_BUNDLED_QT) 285 if(YUZU_USE_BUNDLED_QT)
337 if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64) 286 if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
338 set(QT_BUILD qt-5.15.2-msvc2019_64) 287 set(QT_BUILD qt-5.15.2-msvc2019_64)
@@ -403,71 +352,8 @@ if (ENABLE_SDL2)
403 endif() 352 endif()
404endif() 353endif()
405 354
406# Install any missing dependencies with conan install 355# TODO(lat9nq): Determine what if any of this we still need
407if (CONAN_REQUIRED_LIBS) 356#
408 message(STATUS "Packages ${CONAN_REQUIRED_LIBS} not found!")
409 # Use Conan to fetch the libraries that aren't found
410 # Download conan.cmake automatically, you can also just copy the conan.cmake file
411 if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
412 message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
413 file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/release/0.18/conan.cmake" "${CMAKE_BINARY_DIR}/conan.cmake")
414 endif()
415 include(${CMAKE_BINARY_DIR}/conan.cmake)
416
417 conan_check(VERSION 1.45.0 REQUIRED)
418
419 # Manually add iconv to fix a dep conflict between qt and sdl2
420 # We don't need to add it through find_package or anything since the other two can find it just fine
421 if ("${CONAN_REQUIRED_LIBS}" MATCHES "qt" AND "${CONAN_REQUIRED_LIBS}" MATCHES "sdl")
422 list(APPEND CONAN_REQUIRED_LIBS "libiconv/1.16")
423 endif()
424 if (IS_MULTI_CONFIG)
425 conan_cmake_run(REQUIRES ${CONAN_REQUIRED_LIBS}
426 OPTIONS ${CONAN_LIB_OPTIONS}
427 BUILD missing
428 CONFIGURATION_TYPES "Release;Debug"
429 GENERATORS cmake_multi cmake_find_package_multi)
430 include(${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake)
431 else()
432 conan_cmake_run(REQUIRES ${CONAN_REQUIRED_LIBS}
433 OPTIONS ${CONAN_LIB_OPTIONS}
434 BUILD missing
435 GENERATORS cmake cmake_find_package_multi)
436 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
437 endif()
438 list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}")
439 list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")
440 conan_basic_setup()
441
442 set(YUZU_CONAN_INSTALLED TRUE CACHE BOOL "If true, the following builds will add conan to the lib search path" FORCE)
443
444 # Now that we've installed what we are missing, try to locate them again,
445 # this time with required, so we bail if its not found.
446 yuzu_find_packages(FORCE_REQUIRED)
447
448 if (NOT Boost_FOUND)
449 find_package(Boost 1.73.0 REQUIRED COMPONENTS context headers)
450 set(Boost_LIBRARIES Boost::boost)
451 # Conditionally add Boost::context only if the active version of the Conan Boost package provides it
452 # The old version is missing Boost::context, so we want to avoid adding in that case
453 # The new version requires adding Boost::context to prevent linking issues
454 if (TARGET Boost::context)
455 list(APPEND Boost_LIBRARIES Boost::context)
456 endif()
457 endif()
458
459 # Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function
460 if(ENABLE_QT)
461 list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}")
462 list(APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}")
463 find_package(Qt5 5.15 REQUIRED COMPONENTS Widgets)
464 if (YUZU_USE_QT_WEB_ENGINE)
465 find_package(Qt5 REQUIRED COMPONENTS WebEngineCore WebEngineWidgets)
466 endif()
467 endif()
468
469endif()
470
471# Reexport some targets that are named differently when using the upstream CmakeConfig vs the generated Conan config 357# Reexport some targets that are named differently when using the upstream CmakeConfig vs the generated Conan config
472# In order to ALIAS targets to a new name, they first need to be IMPORTED_GLOBAL 358# In order to ALIAS targets to a new name, they first need to be IMPORTED_GLOBAL
473# Dynarmic checks for target `boost` and so we want to make sure it can find it through our system instead of using their external 359# Dynarmic checks for target `boost` and so we want to make sure it can find it through our system instead of using their external
diff --git a/externals/SDL b/externals/SDL
Subproject 59fb7acbf7af9d64a2d5432bb6677585a0ddd50 Subproject b424665e0899769b200231ba943353a5fee1b6b
diff --git a/externals/dynarmic b/externals/dynarmic
Subproject 1f0a43753e51e4855ee6c0936d30807f373245c Subproject 91d1f944e3870e0f3c505b48f5ec00ca9a82b95
diff --git a/externals/vcpkg b/externals/vcpkg
new file mode 160000
Subproject cef0b3ec767df6e83806899fe9525f6cf8d7bc9
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 73bf626d4..566695fde 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -182,8 +182,9 @@ create_target_directory_groups(common)
182 182
183target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) 183target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads)
184target_link_libraries(common PRIVATE lz4::lz4 xbyak) 184target_link_libraries(common PRIVATE lz4::lz4 xbyak)
185if (MSVC) 185if (TARGET zstd::zstd)
186 target_link_libraries(common PRIVATE zstd::zstd) 186 target_link_libraries(common PRIVATE zstd::zstd)
187else() 187else()
188 target_link_libraries(common PRIVATE zstd) 188 target_link_libraries(common PRIVATE
189 $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>)
189endif() 190endif()
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 9c62ebc60..9116dd77c 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -636,6 +636,10 @@ void AppletMessageQueue::RequestExit() {
636 PushMessage(AppletMessage::Exit); 636 PushMessage(AppletMessage::Exit);
637} 637}
638 638
639void AppletMessageQueue::RequestResume() {
640 PushMessage(AppletMessage::Resume);
641}
642
639void AppletMessageQueue::FocusStateChanged() { 643void AppletMessageQueue::FocusStateChanged() {
640 PushMessage(AppletMessage::FocusStateChanged); 644 PushMessage(AppletMessage::FocusStateChanged);
641} 645}
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 988ead215..53144427b 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -90,6 +90,7 @@ public:
90 AppletMessage PopMessage(); 90 AppletMessage PopMessage();
91 std::size_t GetMessageCount() const; 91 std::size_t GetMessageCount() const;
92 void RequestExit(); 92 void RequestExit();
93 void RequestResume();
93 void FocusStateChanged(); 94 void FocusStateChanged();
94 void OperationModeChanged(); 95 void OperationModeChanged();
95 96
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp
index 5114b8be2..3e9dc4a13 100644
--- a/src/core/hle/service/sockets/bsd.cpp
+++ b/src/core/hle/service/sockets/bsd.cpp
@@ -720,7 +720,25 @@ std::pair<s32, Errno> BSD::RecvImpl(s32 fd, u32 flags, std::vector<u8>& message)
720 if (!IsFileDescriptorValid(fd)) { 720 if (!IsFileDescriptorValid(fd)) {
721 return {-1, Errno::BADF}; 721 return {-1, Errno::BADF};
722 } 722 }
723 return Translate(file_descriptors[fd]->socket->Recv(flags, message)); 723
724 FileDescriptor& descriptor = *file_descriptors[fd];
725
726 // Apply flags
727 if ((flags & FLAG_MSG_DONTWAIT) != 0) {
728 flags &= ~FLAG_MSG_DONTWAIT;
729 if ((descriptor.flags & FLAG_O_NONBLOCK) == 0) {
730 descriptor.socket->SetNonBlock(true);
731 }
732 }
733
734 const auto [ret, bsd_errno] = Translate(descriptor.socket->Recv(flags, message));
735
736 // Restore original state
737 if ((descriptor.flags & FLAG_O_NONBLOCK) == 0) {
738 descriptor.socket->SetNonBlock(false);
739 }
740
741 return {ret, bsd_errno};
724} 742}
725 743
726std::pair<s32, Errno> BSD::RecvFromImpl(s32 fd, u32 flags, std::vector<u8>& message, 744std::pair<s32, Errno> BSD::RecvFromImpl(s32 fd, u32 flags, std::vector<u8>& message,
diff --git a/src/yuzu/configuration/configure_input.ui b/src/yuzu/configuration/configure_input.ui
index 2707025e7..d51774028 100644
--- a/src/yuzu/configuration/configure_input.ui
+++ b/src/yuzu/configuration/configure_input.ui
@@ -166,7 +166,7 @@
166 <item> 166 <item>
167 <widget class="QRadioButton" name="radioUndocked"> 167 <widget class="QRadioButton" name="radioUndocked">
168 <property name="text"> 168 <property name="text">
169 <string>Undocked</string> 169 <string>Handheld</string>
170 </property> 170 </property>
171 </widget> 171 </widget>
172 </item> 172 </item>
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index ed802d329..e60d84054 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1131,6 +1131,7 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
1131 OnPauseGame(); 1131 OnPauseGame();
1132 } else if (!emu_thread->IsRunning() && auto_paused && state == Qt::ApplicationActive) { 1132 } else if (!emu_thread->IsRunning() && auto_paused && state == Qt::ApplicationActive) {
1133 auto_paused = false; 1133 auto_paused = false;
1134 RequestGameResume();
1134 OnStartGame(); 1135 OnStartGame();
1135 } 1136 }
1136 } 1137 }
@@ -2570,6 +2571,7 @@ void GMainWindow::OnPauseContinueGame() {
2570 if (emu_thread->IsRunning()) { 2571 if (emu_thread->IsRunning()) {
2571 OnPauseGame(); 2572 OnPauseGame();
2572 } else { 2573 } else {
2574 RequestGameResume();
2573 OnStartGame(); 2575 OnStartGame();
2574 } 2576 }
2575 } 2577 }
@@ -3749,6 +3751,21 @@ void GMainWindow::RequestGameExit() {
3749 } 3751 }
3750} 3752}
3751 3753
3754void GMainWindow::RequestGameResume() {
3755 auto& sm{system->ServiceManager()};
3756 auto applet_oe = sm.GetService<Service::AM::AppletOE>("appletOE");
3757 auto applet_ae = sm.GetService<Service::AM::AppletAE>("appletAE");
3758
3759 if (applet_oe != nullptr) {
3760 applet_oe->GetMessageQueue()->RequestResume();
3761 return;
3762 }
3763
3764 if (applet_ae != nullptr) {
3765 applet_ae->GetMessageQueue()->RequestResume();
3766 }
3767}
3768
3752void GMainWindow::filterBarSetChecked(bool state) { 3769void GMainWindow::filterBarSetChecked(bool state) {
3753 ui->action_Show_Filter_Bar->setChecked(state); 3770 ui->action_Show_Filter_Bar->setChecked(state);
3754 emit(OnToggleFilterBar()); 3771 emit(OnToggleFilterBar());
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 8cf224c9c..09e37f152 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -244,6 +244,7 @@ private:
244 bool ConfirmChangeGame(); 244 bool ConfirmChangeGame();
245 bool ConfirmForceLockedExit(); 245 bool ConfirmForceLockedExit();
246 void RequestGameExit(); 246 void RequestGameExit();
247 void RequestGameResume();
247 void closeEvent(QCloseEvent* event) override; 248 void closeEvent(QCloseEvent* event) override;
248 249
249private slots: 250private slots:
diff --git a/vcpkg.json b/vcpkg.json
new file mode 100644
index 000000000..8d3c5919a
--- /dev/null
+++ b/vcpkg.json
@@ -0,0 +1,29 @@
1{
2 "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
3 "name": "yuzu",
4 "version": "1.0",
5 "dependencies": [
6 "boost-algorithm",
7 "boost-asio",
8 "boost-bind",
9 "boost-config",
10 "boost-container",
11 "boost-context",
12 "boost-crc",
13 "boost-functional",
14 "boost-icl",
15 "boost-intrusive",
16 "boost-mpl",
17 "boost-process",
18 "boost-range",
19 "boost-spirit",
20 "boost-test",
21 "boost-timer",
22 "boost-variant",
23 "fmt",
24 "lz4",
25 "nlohmann-json",
26 "zlib",
27 "zstd"
28 ]
29}