mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -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
|
# Used to invalidate layer cache but not mount cache
|
||||||
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
|
# 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
|
' >> /emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ENV VCPKG_DEFAULT_BINARY_CACHE /cache/vcpkg
|
ENV VCPKG_DEFAULT_BINARY_CACHE=/cache/vcpkg
|
||||||
RUN --mount=type=cache,target=/cache <<EOF
|
RUN --mount=type=cache,target=/cache <<EOF
|
||||||
# Install dependencies with vcpkg
|
# Install dependencies with vcpkg
|
||||||
set -xe
|
set -xe
|
||||||
@@ -45,7 +45,7 @@ EOF
|
|||||||
|
|
||||||
# Build ImHex
|
# Build ImHex
|
||||||
ARG JOBS=4
|
ARG JOBS=4
|
||||||
ENV CCACHE_DIR /cache/ccache
|
ENV CCACHE_DIR=/cache/ccache
|
||||||
|
|
||||||
RUN mkdir /build
|
RUN mkdir /build
|
||||||
WORKDIR /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
|
# 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
|
RUN du -b /build/imhex.wasm | cut -f1 > imhex.wasm.size
|
||||||
|
|
||||||
FROM scratch as raw
|
FROM scratch AS raw
|
||||||
COPY --from=build [ \
|
COPY --from=build [ \
|
||||||
# ImHex \
|
# ImHex \
|
||||||
"/build/imhex.wasm", \
|
"/build/imhex.wasm", \
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ if (EMSCRIPTEN)
|
|||||||
target_link_options(main PRIVATE -sEXPORTED_RUNTIME_METHODS=ccall)
|
target_link_options(main PRIVATE -sEXPORTED_RUNTIME_METHODS=ccall)
|
||||||
target_link_options(main PRIVATE -sFETCH)
|
target_link_options(main PRIVATE -sFETCH)
|
||||||
target_link_options(main PRIVATE -sWASM_BIGINT)
|
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 -sLEGACY_GL_EMULATION)
|
||||||
target_link_options(main PRIVATE -fsanitize=null)
|
target_link_options(main PRIVATE -fsanitize=null)
|
||||||
target_link_options(main PRIVATE -fsanitize-minimal-runtime)
|
target_link_options(main PRIVATE -fsanitize-minimal-runtime)
|
||||||
|
|||||||
Reference in New Issue
Block a user