aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-10-12 16:07:23 -0400
committerJack Lloyd <[email protected]>2018-10-12 17:02:17 -0400
commitea72317c66b3fe095a95854b6c2b8a48001721ef (patch)
tree118fbb2e19197a40c6157d18da7c16cd76651b52 /doc
parentc8406165f8d38107a3d7dcfe3b7f0938a8a8faa2 (diff)
Add an explicit OS target for Emscripten
This allows things to mostly work out of the box (#1702), and allows us to write Emscripten specific code where required.
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/building.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/manual/building.rst b/doc/manual/building.rst
index 487ae542a..49dc5aa01 100644
--- a/doc/manual/building.rst
+++ b/doc/manual/building.rst
@@ -239,6 +239,22 @@ For Android
Instructions for building the library on Android can be found
`here <https://www.danielseither.de/blog/2013/03/building-the-botan-library-for-android/>`_.
+Emscripten (WebAssembly)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To build for WebAssembly using Emscripten, try::
+
+ CXX=em++ ./configure.py --cc=clang --cpu=llvm --os=emscripten
+ make
+
+This will produce bitcode files ``botan-test.bc`` and ``botan.bc``
+along with a static archive ``libbotan-2.a`` which can linked with
+other modules. To convert the tests into a WASM file which can be
+executed on a browser, use::
+
+ em++ -s ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=0 -s WASM=1 \
+ --preload-file src/tests/data botan-test.bc -o botan-test.html
+
Other Build-Related Tasks
----------------------------------------