summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-11-14 16:59:49 +0100
committerGitHub <noreply@github.com>2021-11-14 16:59:49 +0100
commit0cbe94256e4f600ceb397ddf8c0e3dca60676e5b (patch)
treec180d937da4d539cbc8783f43cdebf4b0dfbce9f
parent5f6303f985928d8fe2a9f75b80a32c9564b88fd6 (diff)
downloadopenttd-0cbe94256e4f600ceb397ddf8c0e3dca60676e5b.tar.xz
Change: [Emscripten] update to 2.0.34 and use Release over RelWithDebInfo (#9696)
It turns out that having "-g" in the compile-statement causes Emscripten to pick -g3, which makes for very big binaries. This is very likely not your intention when building Emscripten, as smaller really is better. For comparison, with RelWithDebInfo the binary is ~80MB. With Release it is ~7.4MB.
-rw-r--r--.github/workflows/preview_build.yml2
-rw-r--r--os/emscripten/Dockerfile2
-rw-r--r--os/emscripten/README.md2
3 files changed, 3 insertions, 3 deletions
diff --git a/.github/workflows/preview_build.yml b/.github/workflows/preview_build.yml
index 345a2152d..2a280a6fc 100644
--- a/.github/workflows/preview_build.yml
+++ b/.github/workflows/preview_build.yml
@@ -76,7 +76,7 @@ jobs:
echo "::group::CMake"
emcmake cmake .. \
-DHOST_BINARY_DIR=../build-host \
- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
diff --git a/os/emscripten/Dockerfile b/os/emscripten/Dockerfile
index cbbff38c1..5d54b5411 100644
--- a/os/emscripten/Dockerfile
+++ b/os/emscripten/Dockerfile
@@ -1,4 +1,4 @@
-FROM emscripten/emsdk:2.0.31
+FROM emscripten/emsdk:2.0.34
COPY emsdk-liblzma.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
diff --git a/os/emscripten/README.md b/os/emscripten/README.md
index 59f17c626..c78dc6727 100644
--- a/os/emscripten/README.md
+++ b/os/emscripten/README.md
@@ -24,7 +24,7 @@ Next, build the game with emscripten:
```
mkdir build
- docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=$(pwd)/build-host -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF
+ 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 -j5
```