mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-40280: Add --with-emscripten-target to build for browser or node (GH-30552)
Co-authored-by: Ethan Smith <ethan@ethanhs.me>
This commit is contained in:
parent
be578e0c06
commit
43839ba438
7 changed files with 164 additions and 22 deletions
|
@ -27,6 +27,8 @@ embuilder build zlib
|
|||
|
||||
### Cross compile to wasm32-emscripten
|
||||
|
||||
For browser:
|
||||
|
||||
```shell
|
||||
mkdir -p builddir/emscripten
|
||||
pushd builddir/emscripten
|
||||
|
@ -35,9 +37,23 @@ CONFIG_SITE=../../Tools/wasm/config.site-wasm32-emscripten \
|
|||
emconfigure ../../configure -C \
|
||||
--host=wasm32-unknown-emscripten \
|
||||
--build=$(../../config.guess) \
|
||||
--with-emscripten-target=browser \
|
||||
--with-build-python=$(pwd)/../build/python
|
||||
|
||||
emmake make -j$(nproc) python.html
|
||||
emmake make -j$(nproc)
|
||||
```
|
||||
|
||||
For node:
|
||||
|
||||
```
|
||||
CONFIG_SITE=../../Tools/wasm/config.site-wasm32-emscripten \
|
||||
emconfigure ../../configure -C \
|
||||
--host=wasm32-unknown-emscripten \
|
||||
--build=$(../../config.guess) \
|
||||
--with-emscripten-target=node \
|
||||
--with-build-python=$(pwd)/../build/python
|
||||
|
||||
emmake make -j$(nproc)
|
||||
```
|
||||
|
||||
### Test in browser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue