From 6b93de22ff396360848dbed0b47b87ea001eef5e Mon Sep 17 00:00:00 2001 From: Carlo van Driesten Date: Mon, 27 Jul 2026 07:57:52 +0200 Subject: [PATCH] fix(build): support Emscripten in the vendored ghc::filesystem copy cpp/externalLibs/Filesystem/filesystem.hpp is a vendored copy of gulrak/filesystem v1.3.2 (GHC_FILESYSTEM_VERSION 10302L), which predates that library's Emscripten support. Emscripten defines __unix__ but not __linux__, and none of the branches in the GHC_OS_DETECTED chain match it, so the header stops at #error "Operating system currently not supported!" and the library cannot be compiled to WebAssembly. Map __EMSCRIPTEN__ onto the existing GHC_OS_LINUX branch: Emscripten's POSIX layer provides everything that branch selects. The new #elif is unreachable unless __EMSCRIPTEN__ is defined, so no existing platform changes preprocessor state and no behaviour changes for any current target. Upstream ghc::filesystem handles Emscripten natively as of v1.5.x (it defines GHC_OS_WEB), so bumping the vendored copy would remove the need for this edit. This commit is the minimal alternative to that bump. Signed-off-by: Carlo van Driesten --- cpp/externalLibs/Filesystem/filesystem.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/externalLibs/Filesystem/filesystem.hpp b/cpp/externalLibs/Filesystem/filesystem.hpp index 1f0fe392..f92b9c3d 100644 --- a/cpp/externalLibs/Filesystem/filesystem.hpp +++ b/cpp/externalLibs/Filesystem/filesystem.hpp @@ -64,6 +64,8 @@ #define GHC_OS_SYS5R4 #elif defined(BSD) #define GHC_OS_BSD +#elif defined(__EMSCRIPTEN__) +#define GHC_OS_LINUX #else #error "Operating system currently not supported!" #endif