Skip to content

Commit 45cd0d1

Browse files
authored
Update emscripten build instructions
1 parent 6cc66be commit 45cd0d1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Emscripten-build-instructions.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,16 @@ cd ./xeus-cpp
126126
mkdir build
127127
cd build
128128
export CMAKE_PREFIX_PATH=$PREFIX
129-
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
129+
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
130+
export SYSROOT_PATH=$HOME/emsdk/upstream/emscripten/cache/sysroot
130131
emcmake cmake \
131132
-DCMAKE_BUILD_TYPE=Release \
132133
-DCMAKE_PREFIX_PATH=$PREFIX \
133134
-DCMAKE_INSTALL_PREFIX=$PREFIX \
134135
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
135136
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
136137
-DCppInterOp_DIR="$CPPINTEROP_BUILD_DIR/lib/cmake/CppInterOp" \
138+
-DSYSROOT_PATH=$SYSROOT_PATH \
137139
..
138140
emmake make -j $(nproc --all) install
139141
```
@@ -148,6 +150,15 @@ python -m pip install jupyterlite-xeus
148150
jupyter lite build --XeusAddon.prefix=$PREFIX
149151
```
150152

153+
We now need to shift necessary files like `xcpp.data` which contains the binary representation of the file(s)
154+
we want to include in our application. As of now this would contain all important files like Standard Headers,
155+
Libraries etc coming out of emscripten's sysroot. Assuming we are still inside build we should do the following
156+
157+
```bash
158+
cp xcpp.data _output/extensions/@jupyterlite/xeus/static
159+
cp $PREFIX/lib/libclangCppInterOp.so _output/extensions/@jupyterlite/xeus/static
160+
```
161+
151162
Once the Jupyter Lite site has built you can test the website locally by executing
152163

153164
```bash

0 commit comments

Comments
 (0)