]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add support for compiling to WebAssembly using Emscripten.
authorPiotr Sikora <piotrsikora@google.com>
Mon, 22 Aug 2022 00:41:54 +0000 (17:41 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 5 Dec 2022 22:24:02 +0000 (23:24 +0100)
Co-authored-by: Nathan Moinvaziri <nathan@nathanm.com>
cmake/detect-arch.c
cmake/detect-arch.cmake

index 43ddb126aeeb891cdb57966f893fdb37669bc8a2..ff1a05a253d51499e009aa609f2d7ede86bfffaa 100644 (file)
         #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
index f0547ba310d1c3b0403fbe5940ad2c380a5d206a..6f29c4a1023e088418888dc018eeffbbbd48a3c7 100644 (file)
@@ -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)