Skip to content

Commit b8c4a0b

Browse files
authored
[Docs] Explain how to make LLVM builds that match the emsdk (#20535)
Also add a comment on how to enable assertions in LLVM.
1 parent 1becb5a commit b8c4a0b

File tree

1 file changed

+6
-2
lines changed
  • site/source/docs/building_from_source

1 file changed

+6
-2
lines changed

site/source/docs/building_from_source/index.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ For example, something like this can work:
3434

3535
mkdir build
3636
cd build/
37-
cmake ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='lld;clang' -DLLVM_TARGETS_TO_BUILD="host;WebAssembly" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF
37+
cmake ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='lld;clang' -DLLVM_TARGETS_TO_BUILD="host;WebAssembly" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF # -DLLVM_ENABLE_ASSERTIONS=ON
3838
cmake --build .
3939

40-
Then point LLVM_ROOT in ``.emscripten`` to ``<llvm_src>/build/bin`` (no need to install).
40+
Then set the environment variable ``EM_LLVM_ROOT`` to ``<llvm_src>/build/bin`` (no need to install).
41+
42+
If you need to match the emsdk releases of LLVM, `review the emscripten-release
43+
build and test scripts <https://chromium.googlesource.com/emscripten-releases/+/refs/heads/main#build-and-test-scripts-in>`_.
44+
Specifically `src/build.py <https://chromium.googlesource.com/emscripten-releases/+/refs/heads/main/src/build.py>`_.
4145

4246
Please refer to the upstream docs for more detail.
4347

0 commit comments

Comments
 (0)