Skip to content

Commit eee9a49

Browse files
authored
Fix build instructions and make start on xeus-cpp instructions
1 parent 947a75c commit eee9a49

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

Emscripten-build-instructions.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# CppInterOp Wasm Build
1+
# Wasm Build Instructions
22

3-
This document contains the instructions on how to build a wasm
3+
## CppInterOp Wasm Build Instructions
4+
5+
This document first starts with the instructions on how to build a wasm
46
build of CppInterOp. Before we start it should be noted that
57
unlike the non wasm version of CppInterOp we currently only
68
support the Clang-REPL backend using llvm>19 for osx and Linux.
@@ -76,7 +78,14 @@ emmake make clang-repl -j $(nproc --all)
7678
emmake make lld -j $(nproc --all)
7779
```
7880

79-
Once this finishes building we can move onto building the wasm
81+
Once this finishes building we need to take note of where we built our
82+
llvm build. This can be done by executing the following
83+
84+
```bash
85+
export LLVM_BUILD_DIR=$PWD
86+
```
87+
88+
We can move onto building the wasm
8089
version of CppInterOp. To do this execute the following
8190

8291
```bash
@@ -92,4 +101,36 @@ emcmake cmake -DCMAKE_BUILD_TYPE=Release \
92101
-DBUILD_SHARED_LIBS=ON \
93102
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
94103
../
104+
emmake make -j $(nproc --all)
105+
```bash
106+
107+
Once this finishes building we need to take note of where we built our
108+
llvm build. This can be done by executing the following
109+
110+
```bash
111+
export CPPINTEROP_BUILD_DIR=$PWD
112+
```
113+
114+
## Xeus-cpp-lite Wasm Build Instructions
115+
116+
A project which makes use of the wasm build of CppInterOp. To build this
117+
execute the following
118+
119+
```bash
120+
cd ../..
121+
git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
122+
cd ./xeus-cpp
123+
mkdir build
124+
cd build
125+
export CMAKE_PREFIX_PATH=${{ env.PREFIX }}
126+
export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }}
127+
emcmake cmake \
128+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
129+
-DCMAKE_PREFIX_PATH=${{ env.PREFIX }} \
130+
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} \
131+
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
132+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
133+
-DCppInterOp_DIR="$CPPINTEROP_BUILD_DIR/lib/cmake/CppInterOp" \
134+
..
135+
emmake make -j $(nproc --all)
95136
```bash

0 commit comments

Comments
 (0)