VERY experimental Nintendo Switch 2 emulator
C++
[port, cmake] fix NetBSD/OpenBSD 7.8 build failure, update documentation (#3272)
lizzied536a6601016
diff --git a/CMakeLists.txt b/CMakeLists.txtindex 175ad7c3f2..dbe947c1bf 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -32,8 +32,8 @@ if (PLATFORM_OPENBSD)set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${CMAKE_SYSROOT}/usr/X11R6/include -D_LIBCPP_PSTL_BACKEND_SERIAL=1")set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_SYSROOT}/usr/X11R6/lib")elseif (PLATFORM_NETBSD)- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_SYSROOT}/usr/X11R7/include")- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${CMAKE_SYSROOT}/usr/X11R7/include")+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_SYSROOT}/usr/X11R7/include -I${CMAKE_SYSROOT}/usr/pkg/include/c++/v1")+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${CMAKE_SYSROOT}/usr/X11R7/include -I${CMAKE_SYSROOT}/usr/pkg/include/c++/v1")set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_SYSROOT}/usr/X11R7/lib")endif()@@ -246,11 +246,12 @@ cmake_dependent_option(YUZU_USE_BUNDLED_MOLTENVK "Download bundled MoltenVK lib"option(YUZU_DISABLE_LLVM "Disable LLVM (useful for CI)" OFF)set(DEFAULT_ENABLE_OPENSSL ON)-if (ANDROID OR WIN32 OR APPLE OR PLATFORM_SUN)+if (ANDROID OR WIN32 OR APPLE OR PLATFORM_SUN OR PLATFORM_OPENBSD)# - Windows defaults to the Schannel backend.# - macOS defaults to the SecureTransport backend.# - Android currently has no SSL backend as the NDK doesn't include any SSL# library; a proper 'native' backend would have to go through Java.+ # - Solaris and OpenBSD have too old backends# But you can force builds for those platforms to use OpenSSL if you have# your own copy of it.set(DEFAULT_ENABLE_OPENSSL OFF)@@ -263,7 +264,7 @@ endif()option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL})set(DEFAULT_YUZU_USE_BUNDLED_OPENSSL OFF)-if (EXT_DEFAULT OR PLATFORM_SUN)+if (EXT_DEFAULT OR PLATFORM_SUN OR PLATFORM_OPENBSD)set(DEFAULT_YUZU_USE_BUNDLED_OPENSSL ON)endif()diff --git a/docs/Caveats.md b/docs/Caveats.mdindex ed98f602d8..39b5ab15e6 100644--- a/docs/Caveats.md+++ b/docs/Caveats.md@@ -85,6 +85,8 @@ If you have `quazip1_qt6_devel`, uninstall it. It may call `Core5Compat` on CMak## OpenBSD+System boost doesn't have `context` (as of 7.8); so you may need to specify `-DYUZU_USE_CPM=ON -DBoost_FORCE_BUNDLED=ON`.+After configuration, you may need to modify `externals/ffmpeg/CMakeFiles/ffmpeg-build/build.make` to use `-j$(nproc)` instead of just `-j`.`-lc++-experimental` doesn't exist in OpenBSD but the LLVM driver still tries to link against it, to solve just symlink `ln -s /usr/lib/libc++.a /usr/lib/libc++experimental.a`. Builds are currently not working due to lack of `std::jthread` and such, either compile libc++ manually or wait for ports to catch up.diff --git a/docs/Deps.md b/docs/Deps.mdindex 689d12800a..c91d6fc4fb 100644--- a/docs/Deps.md+++ b/docs/Deps.md@@ -277,7 +277,7 @@ For NetBSD +10.1: `pkgin install git cmake boost fmtlib SDL2 catch2 libjwt spirv```shpkg_add -u-pkg_add cmake nasm git boost unzip--iconv autoconf-2.72p0 bash ffmpeg glslang gmake llvm-19.1.7p3 qt6 jq fmt nlohmann-json enet boost vulkan-utility-libraries vulkan-headers spirv-headers spirv-tools catch2 sdl2 libusb1-1.0.27+pkg_add cmake nasm git boost unzip--iconv autoconf-2.72p0 bash ffmpeg glslang gmake qt6 jq fmt nlohmann-json enet boost vulkan-utility-libraries vulkan-headers spirv-headers spirv-tools catch2 sdl2 libusb1-1.0.29```[Caveats](./Caveats.md#openbsd).diff --git a/docs/Development.md b/docs/Development.mdindex 062bc140d9..eb9f4159b5 100644--- a/docs/Development.md+++ b/docs/Development.md@@ -82,15 +82,15 @@ You may additionally need the `Qt Extension Pack` extension if building Qt.# Build speedup-If you have an HDD, use ramdisk (build in RAM):+If you have an HDD, use ramdisk (build in RAM), approximatedly you need 4GB for a full build with debug symbols:```sh-sudo mkdir /tmp/ramdisk-sudo chmod 777 /tmp/ramdisk+mkdir /tmp/ramdisk+chmod 777 /tmp/ramdisk# about 8GB needed-sudo mount -t tmpfs -o size=8G myramdisk /tmp/ramdisk+mount -t tmpfs -o size=4G myramdisk /tmp/ramdiskcmake -B /tmp/ramdiskcmake --build /tmp/ramdisk -- -j32-sudo umount /tmp/ramdisk+umount /tmp/ramdisk```# Assets and large filesdiff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txtindex 40fa4968a8..60b399ccba 100644--- a/src/video_core/host_shaders/CMakeLists.txt+++ b/src/video_core/host_shaders/CMakeLists.txt@@ -14,68 +14,68 @@ set(GLSL_INCLUDES)set(SHADER_FILES- astc_decoder.comp- blit_color_float.frag- block_linear_unswizzle_2d.comp- block_linear_unswizzle_3d.comp- block_linear_unswizzle_3d_bcn.comp- convert_abgr8_to_d24s8.frag- convert_abgr8_to_d32f.frag- convert_d32f_to_abgr8.frag- convert_d24s8_to_abgr8.frag- convert_depth_to_float.frag- convert_float_to_depth.frag- convert_msaa_to_non_msaa.comp- convert_non_msaa_to_msaa.comp- convert_s8d24_to_abgr8.frag- full_screen_triangle.vert- fxaa.frag- fxaa.vert- opengl_convert_s8d24.comp- opengl_copy_bc4.comp- opengl_fidelityfx_fsr.frag- opengl_fidelityfx_fsr_easu.frag- opengl_fidelityfx_fsr_rcas.frag- opengl_lmem_warmup.comp- opengl_present.frag- opengl_present.vert- opengl_present_scaleforce.frag- opengl_smaa.glsl- pitch_unswizzle.comp- present_area.frag- present_bicubic.frag- present_zero_tangent.frag- present_bspline.frag- present_mitchell.frag- present_gaussian.frag- present_lanczos.frag- present_spline1.frag- present_mmpx.frag- queries_prefix_scan_sum.comp- queries_prefix_scan_sum_nosubgroups.comp- resolve_conditional_render.comp- smaa_edge_detection.vert- smaa_edge_detection.frag- smaa_blending_weight_calculation.vert- smaa_blending_weight_calculation.frag- smaa_neighborhood_blending.vert- smaa_neighborhood_blending.frag- vulkan_blit_depth_stencil.frag- vulkan_color_clear.frag- vulkan_color_clear.vert- vulkan_depthstencil_clear.frag- vulkan_fidelityfx_fsr.vert- vulkan_fidelityfx_fsr_easu_fp16.frag- vulkan_fidelityfx_fsr_easu_fp32.frag- vulkan_fidelityfx_fsr_rcas_fp16.frag- vulkan_fidelityfx_fsr_rcas_fp32.frag- vulkan_present.frag- vulkan_present.vert- vulkan_present_scaleforce_fp16.frag- vulkan_present_scaleforce_fp32.frag- vulkan_quad_indexed.comp- vulkan_turbo_mode.comp- vulkan_uint8.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/astc_decoder.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/blit_color_float.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/block_linear_unswizzle_2d.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/block_linear_unswizzle_3d.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/block_linear_unswizzle_3d_bcn.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_abgr8_to_d24s8.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_abgr8_to_d32f.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_d32f_to_abgr8.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_d24s8_to_abgr8.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_depth_to_float.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_float_to_depth.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_msaa_to_non_msaa.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_non_msaa_to_msaa.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/convert_s8d24_to_abgr8.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/full_screen_triangle.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/fxaa.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/fxaa.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_convert_s8d24.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_copy_bc4.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_fidelityfx_fsr.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_fidelityfx_fsr_easu.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_fidelityfx_fsr_rcas.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_lmem_warmup.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_present.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_present.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_present_scaleforce.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/opengl_smaa.glsl+ ${CMAKE_CURRENT_SOURCE_DIR}/pitch_unswizzle.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/present_area.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/present_bicubic.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/present_zero_tangent.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/present_bspline.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/present_mitchell.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/present_gaussian.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/present_lanczos.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/present_spline1.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/present_mmpx.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/queries_prefix_scan_sum.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/queries_prefix_scan_sum_nosubgroups.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/resolve_conditional_render.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/smaa_edge_detection.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/smaa_edge_detection.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/smaa_blending_weight_calculation.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/smaa_blending_weight_calculation.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/smaa_neighborhood_blending.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/smaa_neighborhood_blending.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_blit_depth_stencil.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_color_clear.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_color_clear.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_depthstencil_clear.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_fidelityfx_fsr.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_fidelityfx_fsr_easu_fp16.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_fidelityfx_fsr_easu_fp32.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_fidelityfx_fsr_rcas_fp16.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_fidelityfx_fsr_rcas_fp32.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_present.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_present.vert+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_present_scaleforce_fp16.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_present_scaleforce_fp32.frag+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_quad_indexed.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_turbo_mode.comp+ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan_uint8.comp)if (PLATFORM_HAIKU)@@ -118,9 +118,9 @@ if (NOT GLSLANG_ERROR STREQUAL "")set(QUIET_FLAG "")endif()-foreach(FILENAME IN ITEMS ${SHADER_FILES})+foreach(SOURCE_FILE IN ITEMS ${SHADER_FILES})+ get_filename_component(FILENAME ${SOURCE_FILE} NAME)string(REPLACE "." "_" SHADER_NAME ${FILENAME})- set(SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME})# Skip generating source headers on Vulkan exclusive filesif (NOT ${FILENAME} MATCHES "vulkan.*")set(SOURCE_HEADER_FILE ${SHADER_DIR}/${SHADER_NAME}.h)