summaryrefslogtreecommitdiff
path: root/os/emscripten/cmake/FindZLIB.cmake
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2020-12-05 21:57:47 +0100
committerPatric Stout <github@truebrain.nl>2020-12-15 15:46:39 +0100
commitd15dc9f40f5a20bff452547a2dcb15231f9f969d (patch)
tree7b8d88635c048d906cbb6358007fb26055e24410 /os/emscripten/cmake/FindZLIB.cmake
parent2da07f76154d841bcfe9aaff4833144550186deb (diff)
downloadopenttd-d15dc9f40f5a20bff452547a2dcb15231f9f969d.tar.xz
Add: support for emscripten (play-OpenTTD-in-the-browser)
Emscripten compiles to WASM, which can be loaded via HTML / JavaScript. This allows you to play OpenTTD inside a browser. Co-authored-by: milek7 <me@milek7.pl>
Diffstat (limited to 'os/emscripten/cmake/FindZLIB.cmake')
-rw-r--r--os/emscripten/cmake/FindZLIB.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/os/emscripten/cmake/FindZLIB.cmake b/os/emscripten/cmake/FindZLIB.cmake
new file mode 100644
index 000000000..2ade2ba1b
--- /dev/null
+++ b/os/emscripten/cmake/FindZLIB.cmake
@@ -0,0 +1,7 @@
+add_library(ZLIB::ZLIB INTERFACE IMPORTED)
+set_target_properties(ZLIB::ZLIB PROPERTIES
+ INTERFACE_COMPILE_OPTIONS "-sUSE_ZLIB=1"
+ INTERFACE_LINK_LIBRARIES "-sUSE_ZLIB=1"
+)
+
+set(ZLIB_FOUND on)