2021-10-08 23:07:09 +02:00
|
|
|
FROM dockcross/base:latest
|
|
|
|
|
|
|
|
LABEL maintainer="Matt McCormick matt.mccormick@kitware.com"
|
|
|
|
|
|
|
|
# The cross-compiling emulator
|
2021-11-04 00:28:11 +01:00
|
|
|
ENV WASMTIME_HOME /usr/local/wasmtime
|
|
|
|
RUN mkdir ${WASMTIME_HOME} && curl https://wasmtime.dev/install.sh -sSf | bash
|
|
|
|
COPY wasmtime-pwd.sh ${WASMTIME_HOME}/bin/
|
|
|
|
ENV PATH "$WASMTIME_HOME/bin:$PATH"
|
2021-10-08 23:07:09 +02:00
|
|
|
|
|
|
|
ENV WASI_VERSION 12
|
|
|
|
ENV WASI_VERSION_FULL ${WASI_VERSION}.0
|
|
|
|
RUN cd /usr/ && \
|
|
|
|
curl -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz && \
|
|
|
|
tar xvzf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz && \
|
|
|
|
rm wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
|
|
|
|
ENV WASI_SDK_PATH /usr/wasi-sdk-${WASI_VERSION_FULL}
|
|
|
|
ENV WASI_SYSROOT ${WASI_SDK_PATH}/share/wasi-sysroot
|
|
|
|
|
2021-11-04 00:28:11 +01:00
|
|
|
COPY clang-wasi-sysroot.sh clang++-wasi-sysroot.sh wasmtime-pwd.sh /usr/local/bin/
|
2021-10-08 23:07:09 +02:00
|
|
|
|
|
|
|
ENV CROSS_TRIPLE=wasm32-wasi
|
|
|
|
ENV CROSS_ROOT=${WASI_SDK_PATH}
|
|
|
|
ENV ANDROID_NDK=${CROSS_ROOT}
|
|
|
|
ENV AR=${CROSS_ROOT}/bin/llvm-ar \
|
|
|
|
CC=clang-wasi-sysroot.sh \
|
|
|
|
CXX=clang++-wasi-sysroot.sh \
|
|
|
|
LD=${CROSS_ROOT}/bin/wasm-ld
|
|
|
|
|
2021-10-13 21:40:49 +02:00
|
|
|
COPY WASI.cmake /usr/src/
|
|
|
|
RUN mv /usr/src/WASI.cmake /usr/share/cmake-*/Modules/Platform/
|
2021-10-08 23:07:09 +02:00
|
|
|
COPY Toolchain.cmake ${CROSS_ROOT}/
|
|
|
|
ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake
|
|
|
|
|
|
|
|
#include "common.label-and-env"
|