Skip to content

Commit

Permalink
Update Emscripten build documentation to reflect that CppInterOp can …
Browse files Browse the repository at this point in the history
…now be tested
  • Loading branch information
mcbarton authored Feb 9, 2025
1 parent 625fec5 commit 027e9a3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions Emscripten-build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ git clone https://github.com/emscripten-core/emsdk.git
./emsdk/emsdk install 3.1.73
```

and activate the emsdk environment
and activate the emsdk environment (we are defining SYSROOT_PATH for use later)

```bash
./emsdk/emsdk activate 3.1.73
source ./emsdk/emsdk_env.sh
export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot
```

Now clone the 19.x release of the LLVM project repository and CppInterOp (the building of the emscripten version of llvm can be
Expand Down Expand Up @@ -97,7 +98,7 @@ export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
```

Now to build CppInterOp execute the following
Now to build and test your Emscripten build of CppInterOp by executing the following

```bash
mkdir build
Expand All @@ -109,7 +110,14 @@ emcmake cmake -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DSYSROOT_PATH=$SYSROOT_PATH \
../
emmake make -j $(nproc --all) check-cppinterop
```

Assuming it passes all test you can install by executing the following

```bash
emmake make -j $(nproc --all) install
```

Expand All @@ -126,7 +134,6 @@ the CppInterOp build folder, you can build the wasm version of xeus-cpp by execu

```bash
cd ../..
export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot
git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
cd ./xeus-cpp
mkdir build
Expand Down
13 changes: 10 additions & 3 deletions docs/Emscripten-build-instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ This can be installed by executing (we only currently support version
git clone https://github.com/emscripten-core/emsdk.git
./emsdk/emsdk install 3.1.73
and activate the emsdk environment
and activate the emsdk environment (we are defining SYSROOT_PATH for use later)

.. code:: bash
./emsdk/emsdk activate 3.1.73
source ./emsdk/emsdk_env.sh
export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot
Now clone the 19.x release of the LLVM project repository and CppInterOp
(the building of the emscripten version of llvm can be avoided by
Expand Down Expand Up @@ -115,7 +116,7 @@ You will also want to set a few environment variables
export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
Now to build CppInterOp execute the following
Now to build and test your Emscripten build of CppInterOp by executing the following

.. code:: bash
Expand All @@ -128,7 +129,14 @@ Now to build CppInterOp execute the following
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DSYSROOT_PATH=$SYSROOT_PATH \
../
emmake make -j $(nproc --all) check-cppinterop
Assuming it passes all test you can install by executing the following.

.. code:: bash
emmake make -j $(nproc --all) install
Once this finishes building we need to take note of where we built
Expand All @@ -147,7 +155,6 @@ build folder, you can build the wasm version of xeus-cpp by executing
.. code:: bash
cd ../..
export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot
git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
cd ./xeus-cpp
mkdir build
Expand Down

0 comments on commit 027e9a3

Please sign in to comment.