VERY experimental Nintendo Switch 2 emulator
C++
[ports] build fixes for *BSD make (#3496)
lizzief2c46eadc15e
diff --git a/docs/Caveats.md b/docs/Caveats.mdindex 39b5ab15e6..d554f3ff77 100644--- a/docs/Caveats.md+++ b/docs/Caveats.md@@ -91,7 +91,7 @@ After configuration, you may need to modify `externals/ffmpeg/CMakeFiles/ffmpeg-`-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.-If clang has errors, try using `g++-11`.+If clang has errors, try using `g++11`.## FreeBSD@@ -107,6 +107,8 @@ hw.usb.usbhid.enable="0"## NetBSD+2026-02-07: `vulkan-headers` must not be installed, since the version found in `pkgsrc` is older than required. Either wait for binary packages to update or build newer versions from source.+Install `pkgin` if not already `pkg_add pkgin`, see also the general [pkgsrc guide](https://www.netbsd.org/docs/pkgsrc/using.html). For NetBSD 10.1 provide `echo 'PKG_PATH="https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.1/All/"' >/etc/pkg_install.conf`. If `pkgin` is taking too much time consider adding the following to `/etc/rc.conf`:```sh@@ -116,7 +118,7 @@ ip6addrctl_policy=ipv4_preferSystem provides a default `g++-10` which doesn't support the current C++ codebase; install `clang-19` with `pkgin install clang-19`. Or install `gcc14` (or `gcc15` with current pkgsrc). Provided that, the following CMake commands may work:-- `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Bbuild`+- `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Bbuild` (Recommended)- `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/pkg/gcc14/bin/gcc -DCMAKE_CXX_COMPILER=/usr/pkg/gcc14/bin/g++ -Bbuild`- `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/pkg/gcc15/bin/gcc -DCMAKE_CXX_COMPILER=/usr/pkg/gcc15/bin/g++ -Bbuild`@@ -138,8 +140,12 @@ cmake --install buildHowever, pkgsrc is highly recommended, see [getting pkgsrc](https://iso.us.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/pkgsrc.html#getting). You must get `current` not the `2025Q2` version.+`QtCore` on NetBSD is included, but due to misconfigurations(!) we MUST include one of the standard headers that include `bits/c++config.h`, since source_location (required by `QtCore`) isn't properly configured to intake `bits/c++config.h` (none of the experimental library is). This is a bug with NetBSD packaging and not our fault, but alas.+## DragonFlyBSD+2026-02-07: `vulkan-headers` and `vulkan-utility-libraries` must NOT be uninstalled, since they're too old: `1.3.289`. Either wait for binary packages to update or build newer versions from source.+If `libstdc++.so.6` is not found (`GLIBCXX_3.4.30`) then attempt:```shdiff --git a/src/common/thread.cpp b/src/common/thread.cppindex eac0f60131..b0b63ae35c 100644--- a/src/common/thread.cpp+++ b/src/common/thread.cpp@@ -19,10 +19,12 @@#include <windows.h>#include "common/string_util.h"#else-#if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)+#if defined(__FreeBSD__)#include <sys/cpuset.h>#include <sys/_cpuset.h>#include <pthread_np.h>+#elif defined(__DragonFly__) || defined(__OpenBSD__) || defined(__Bitrig__)+#include <pthread_np.h>#endif#include <pthread.h>#include <sched.h>diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txtindex 60b399ccba..668f939546 100644--- a/src/video_core/host_shaders/CMakeLists.txt+++ b/src/video_core/host_shaders/CMakeLists.txt@@ -118,6 +118,8 @@ if (NOT GLSLANG_ERROR STREQUAL "")set(QUIET_FLAG "")endif()+# Shader files must depend on their directory otherwise *BSD make will spontaneously combust+file(MAKE_DIRECTORY "${SHADER_DIR}")foreach(SOURCE_FILE IN ITEMS ${SHADER_FILES})get_filename_component(FILENAME ${SOURCE_FILE} NAME)string(REPLACE "." "_" SHADER_NAME ${FILENAME})@@ -133,6 +135,7 @@ foreach(SOURCE_FILE IN ITEMS ${SHADER_FILES})${SOURCE_FILE}DEPENDS${INPUT_FILE}+ ${SHADER_DIR}# HEADER_GENERATOR should be included here but msbuild seems to assume it's always modified)set(SHADER_HEADERS ${SHADER_HEADERS} ${SOURCE_HEADER_FILE})@@ -148,6 +151,8 @@ foreach(SOURCE_FILE IN ITEMS ${SHADER_FILES})${GLSLANGVALIDATOR} -V ${QUIET_FLAG} -I"${FIDELITYFX_INCLUDE_DIR}" ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE} --target-env ${SPIR_V_VERSION}MAIN_DEPENDENCY${SOURCE_FILE}+ DEPENDS+ ${SHADER_DIR})set(SHADER_HEADERS ${SHADER_HEADERS} ${SPIRV_HEADER_FILE})endif()@@ -167,6 +172,7 @@ foreach(FILEPATH IN ITEMS ${FIDELITYFX_FILES})${SOURCE_FILE}DEPENDS${INPUT_FILE}+ ${SHADER_DIR}# HEADER_GENERATOR should be included here but msbuild seems to assume it's always modified)set(SHADER_HEADERS ${SHADER_HEADERS} ${SOURCE_HEADER_FILE})