Merge commit '13.0-RC1~2'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM emscripten/emsdk:2.0.34
|
||||
FROM emscripten/emsdk:3.1.28
|
||||
|
||||
COPY emsdk-liblzma.patch /
|
||||
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
|
||||
|
||||
+25
-10
@@ -1,23 +1,38 @@
|
||||
## How to build with Emscripten
|
||||
|
||||
Building with Emscripten works with emsdk 3.0.0 and above.
|
||||
|
||||
You will also need libharfbuzz-dev and libicu-dev installed on your host OS.
|
||||
|
||||
Please use docker with the supplied `Dockerfile` to build for emscripten.
|
||||
It takes care of a few things:
|
||||
- Use a version of emscripten we know works
|
||||
- Patch in LibLZMA support (as this is not supported by upstream)
|
||||
|
||||
First, build the docker image by navigating in the folder this `README.md` is in, and executing:
|
||||
```
|
||||
sudo apt-get install autoconf automake libtool gperf libharfbuzz-dev libicu-dev libfreetype-dev
|
||||
|
||||
./emscripten-build.sh
|
||||
docker build -t emsdk-lzma .
|
||||
```
|
||||
|
||||
And now you have in your build folder files like "openttd.html".
|
||||
Next, navigate back to the root folder of this project.
|
||||
|
||||
To run it locally, you would have to start a local webserver, like:
|
||||
Now we build the host tools first:
|
||||
```
|
||||
mkdir build-host
|
||||
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-lzma cmake .. -DOPTION_TOOLS_ONLY=ON
|
||||
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-lzma make -j$(nproc) tools
|
||||
```
|
||||
|
||||
Finally, we build the actual game:
|
||||
```
|
||||
mkdir build
|
||||
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=../build-host -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_ASSERTS=OFF
|
||||
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emmake make -j$(nproc)
|
||||
```
|
||||
|
||||
In the `build` folder you will now see `openttd.html`.
|
||||
|
||||
To run it locally, you would have to start a local webserver; something like:
|
||||
|
||||
```
|
||||
cd build
|
||||
python3 -m http.server
|
||||
````
|
||||
|
||||
Now you can play the game via http://127.0.0.1:8000/openttd.html .
|
||||
You can now play the game via http://127.0.0.1:8000/openttd.html .
|
||||
|
||||
Reference in New Issue
Block a user