mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
build: Properly optimize web build
This commit is contained in:
8
dist/web/Dockerfile
vendored
8
dist/web/Dockerfile
vendored
@@ -1,4 +1,4 @@
|
||||
FROM emscripten/emsdk:3.1.51 as build
|
||||
FROM emscripten/emsdk:3.1.51 AS build
|
||||
|
||||
# Used to invalidate layer cache but not mount cache
|
||||
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
|
||||
@@ -27,7 +27,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||
' >> /emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
|
||||
EOF
|
||||
|
||||
ENV VCPKG_DEFAULT_BINARY_CACHE /cache/vcpkg
|
||||
ENV VCPKG_DEFAULT_BINARY_CACHE=/cache/vcpkg
|
||||
RUN --mount=type=cache,target=/cache <<EOF
|
||||
# Install dependencies with vcpkg
|
||||
set -xe
|
||||
@@ -45,7 +45,7 @@ EOF
|
||||
|
||||
# Build ImHex
|
||||
ARG JOBS=4
|
||||
ENV CCACHE_DIR /cache/ccache
|
||||
ENV CCACHE_DIR=/cache/ccache
|
||||
|
||||
RUN mkdir /build
|
||||
WORKDIR /build
|
||||
@@ -80,7 +80,7 @@ EOF
|
||||
# See https://stackoverflow.com/questions/41701849/cannot-modify-accept-encoding-with-fetch https://github.com/AnthumChris/fetch-progress-indicators/issues/13
|
||||
RUN du -b /build/imhex.wasm | cut -f1 > imhex.wasm.size
|
||||
|
||||
FROM scratch as raw
|
||||
FROM scratch AS raw
|
||||
COPY --from=build [ \
|
||||
# ImHex \
|
||||
"/build/imhex.wasm", \
|
||||
|
||||
@@ -44,7 +44,7 @@ if (EMSCRIPTEN)
|
||||
target_link_options(main PRIVATE -sEXPORTED_RUNTIME_METHODS=ccall)
|
||||
target_link_options(main PRIVATE -sFETCH)
|
||||
target_link_options(main PRIVATE -sWASM_BIGINT)
|
||||
target_link_options(main PRIVATE -O1)
|
||||
target_link_options(main PRIVATE -O2)
|
||||
target_link_options(main PRIVATE -sLEGACY_GL_EMULATION)
|
||||
target_link_options(main PRIVATE -fsanitize=null)
|
||||
target_link_options(main PRIVATE -fsanitize-minimal-runtime)
|
||||
|
||||
Reference in New Issue
Block a user