From: Piotr Sikora Date: Mon, 22 Aug 2022 00:41:54 +0000 (-0700) Subject: Add support for compiling to WebAssembly using Emscripten. X-Git-Tag: 2.1.0-beta1~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60ed1ab3e77531595c606d71cc35237af556fced;p=thirdparty%2Fzlib-ng.git Add support for compiling to WebAssembly using Emscripten. Co-authored-by: Nathan Moinvaziri --- diff --git a/cmake/detect-arch.c b/cmake/detect-arch.c index 43ddb126a..ff1a05a25 100644 --- a/cmake/detect-arch.c +++ b/cmake/detect-arch.c @@ -101,6 +101,10 @@ #error archfound riscv32 #endif +// Emscripten (WebAssembly) +#elif defined(__EMSCRIPTEN__) + #error archfound wasm32 + // return 'unrecognized' if we do not know what architecture this is #else #error archfound unrecognized diff --git a/cmake/detect-arch.cmake b/cmake/detect-arch.cmake index f0547ba31..6f29c4a10 100644 --- a/cmake/detect-arch.cmake +++ b/cmake/detect-arch.cmake @@ -88,6 +88,9 @@ elseif("${ARCH}" MATCHES "rs6000") elseif("${ARCH}" MATCHES "riscv(32|64)") set(BASEARCH "riscv") set(BASEARCH_RISCV_FOUND TRUE) +elseif("${ARCH}" MATCHES "wasm32") + set(BASEARCH "wasm32") + set(BASEARCH_WASM32_FOUND TRUE) else() set(BASEARCH "x86") set(BASEARCH_X86_FOUND TRUE)