From 2b4d6013efcc851a54122964fd09ccb589ba3a6a Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 24 May 2021 15:30:55 +0100 Subject: [PATCH] cmake: Enforce Linux platform in wasm32-wasi --- cmake/toolchains/wasm32-wasi.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/toolchains/wasm32-wasi.cmake b/cmake/toolchains/wasm32-wasi.cmake index 485bebb7..a77f0265 100644 --- a/cmake/toolchains/wasm32-wasi.cmake +++ b/cmake/toolchains/wasm32-wasi.cmake @@ -10,3 +10,8 @@ if(NOT WASI_SDK_PREFIX STREQUAL /opt/wasi-sdk) endif() include(${WASI_SDK_PREFIX}/share/cmake/wasi-sdk.cmake) + +# Override the default in wasi-sdk.cmake which sets it at "WASI" +# That does not exists in CMake Platforms, and as a result falls back to the host +# toolchain, which on macOS includes extra linker flags. +set(CMAKE_SYSTEM_NAME Linux)