Re: Sword as a WASM library

Kovács Zoltán <[email protected]>
Newsgroups gmane.comp.literature.sword.devel
Message-ID <CACQaL-KAWU+Apbn-eCX_v7_Udy=gohshA7hQmeBmG6Yx_CJi4g@mail.gmail.com>
> I will send you a detailed description on how one could easily build it
> from scratch (in a different email).
>

After some unsuccessful attempts to simplify the process, this is how it
seems to be the easiest way for the moment (see also
https://github.com/kovzol/bibref/blob/master/.github/workflows/build.yml#L27-L41
for a working GitHub action inside an application based on Sword), in a
shell under Linux (I used Ubuntu 21.10, but this should be irrelevant):

git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 2.0.22
./emsdk activate 2.0.22
cd ..
. emsdk/emsdk_env.sh
git clone https://github.com/kovzol/crosswire-sword-mirror
cd crosswire-sword-mirror
mkdir build
cd build
sudo apt install subversion # This is required, otherwise the cmake step
will fail.
emcmake cmake ..
emmake make sword_static

An application based on the WASM build of libsword.a can be compiled and
linked as shown in https://github.com/kovzol/bibref/blob/master/Makefile.
The steps are explained in the beginning of this Makefile, including the
compilation steps of libsword.a as well.

I hope this helps. ;-)

Best, Zoltan

_______________________________________________
sword-devel mailing list: [email protected]
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.