forked from external-repos/squoosh
Use a shared base image with fixed Emscripten version, autotools and optimisation flags for all C++ codecs. Additionally, move build commands for codecs themselves to Makefile - they're already platform-specific, and Make allows for better caching and parallelisation that custom ad-hoc scripts. This is essentially same as #777 but for C++.
10 lines
350 B
Docker
10 lines
350 B
Docker
FROM emscripten/emsdk:1.39.19
|
|
RUN apt-get update && apt-get install -qqy autoconf libtool pkg-config
|
|
ENV CFLAGS "-Os -flto"
|
|
ENV CXXFLAGS "${CFLAGS} -std=c++17"
|
|
ENV LDFLAGS "${CFLAGS}"
|
|
# Build and cache standard libraries with these flags
|
|
RUN emcc ${CXXFLAGS} --bind -xc++ /dev/null -o /dev/null
|
|
WORKDIR /src
|
|
CMD ["sh", "-c", "emmake make -j`nproc`"]
|