From 93b23ec9972f8c5fd90cbd37fdd755987b5e24b8 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 13 Oct 2021 15:40:49 -0400 Subject: [PATCH 1/2] web-wasi: Patch CMake with WASI platform WASI.cmake taken from the wasi-sdk repository. To address the build time warning: System is unknown to cmake, create: Platform/WASI to use this system, please post your config file on discourse.cmake.org so it can be added to cmake --- web-wasi/Dockerfile.in | 2 ++ web-wasi/Toolchain.cmake | 2 -- web-wasi/WASI.cmake | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 web-wasi/WASI.cmake diff --git a/web-wasi/Dockerfile.in b/web-wasi/Dockerfile.in index 3399f44..fa80be8 100644 --- a/web-wasi/Dockerfile.in +++ b/web-wasi/Dockerfile.in @@ -26,6 +26,8 @@ ENV AR=${CROSS_ROOT}/bin/llvm-ar \ CXX=clang++-wasi-sysroot.sh \ LD=${CROSS_ROOT}/bin/wasm-ld +COPY WASI.cmake /usr/src/ +RUN mv /usr/src/WASI.cmake /usr/share/cmake-*/Modules/Platform/ COPY Toolchain.cmake ${CROSS_ROOT}/ ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake diff --git a/web-wasi/Toolchain.cmake b/web-wasi/Toolchain.cmake index bd75c38..74f6395 100644 --- a/web-wasi/Toolchain.cmake +++ b/web-wasi/Toolchain.cmake @@ -1,5 +1,3 @@ -set(WASI 1) - include($ENV{WASI_SDK_PATH}/share/cmake/wasi-sdk.cmake) set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT}) diff --git a/web-wasi/WASI.cmake b/web-wasi/WASI.cmake new file mode 100644 index 0000000..b49713f --- /dev/null +++ b/web-wasi/WASI.cmake @@ -0,0 +1 @@ +set(WASI 1) From ef0ff63ed92bd316f9eb78640e816d344b3a9596 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 13 Oct 2021 23:47:29 -0400 Subject: [PATCH 2/2] web-wasi: Initialize WASI_SDK_PATH for wasi-sdk.cmake, set UNIX --- web-wasi/Toolchain.cmake | 1 + web-wasi/WASI.cmake | 1 + 2 files changed, 2 insertions(+) diff --git a/web-wasi/Toolchain.cmake b/web-wasi/Toolchain.cmake index 74f6395..1e747bb 100644 --- a/web-wasi/Toolchain.cmake +++ b/web-wasi/Toolchain.cmake @@ -1,3 +1,4 @@ +set(WASI_SDK_PREFIX $ENV{WASI_SDK_PATH}) include($ENV{WASI_SDK_PATH}/share/cmake/wasi-sdk.cmake) set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT}) diff --git a/web-wasi/WASI.cmake b/web-wasi/WASI.cmake index b49713f..8bb6cb7 100644 --- a/web-wasi/WASI.cmake +++ b/web-wasi/WASI.cmake @@ -1 +1,2 @@ set(WASI 1) +set(UNIX 1)