Skip to content

Commit 1cafe9f

Browse files
committed
build(docker): overwrite dockcross wasi CMake toolchain file with our flags
For emulated process clocks, signals, etc.
1 parent c78034a commit 1cafe9f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/docker/itk-wasm-base/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ LABEL org.opencontainers.image.source="https://github.com/InsightSoftwareConsort
99
WORKDIR /
1010

1111
COPY itk_wasm_env_vars.sh /
12+
COPY wasi-toolchain.cmake /opt/wasi-sdk/Toolchain.cmake
1213

1314
# Note: on entry, emsdk will prepend to the path with its own node, so add to an earlier path
1415
ENV NODE_TAG=v22.9.0
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(WASI_SDK_PREFIX $ENV{WASI_SDK_PATH})
2+
include($ENV{WASI_SDK_PATH}/share/cmake/wasi-sdk.cmake)
3+
4+
set(WASI 1)
5+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto -msimd128 -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PTHREAD")
6+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -msimd128 -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PTHREAD")
7+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto -lc-printscan-long-double -lwasi-emulated-process-clocks -lwasi-emulated-signal -lwasi-emulated-pthread")
8+
9+
set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT})
10+
set(CMAKE_SYSROOT $ENV{WASI_SYSROOT})
11+
12+
set(CMAKE_C_COMPILER /usr/local/bin/clang-wasi-sysroot.sh)
13+
set(CMAKE_CXX_COMPILER /usr/local/bin/clang++-wasi-sysroot.sh)
14+
15+
set(CMAKE_CROSSCOMPILING_EMULATOR /wasi-runtimes/wasmtime/bin/wasmtime-pwd.sh)

0 commit comments

Comments
 (0)