I'm running into trouble when trying to build the clangd language server protocol using wasi-sdk on macOS 15.
I'm using the following script:
#!/bin/bash
set -e -o pipefail
export PATH="$HOME/opt/wasi-sdk-27.0-arm64-macos:$PATH"
export WASI_SDK_PATH="$HOME/opt/wasi-sdk-27.0-arm64-macos"
export WASI_TOOLCHAIN_FILE="${WASI_SDK_PATH}/share/cmake/wasi-sdk.cmake"
cd /tmp
rm -rf build-wasm
mkdir -p build-wasm
cd build-wasm
cmake -G "Unix Makefiles" \
-DCMAKE_TOOLCHAIN_FILE="${WASI_TOOLCHAIN_FILE}" \
-DCMAKE_SYSROOT="${WASI_SDK_PATH}/share/wasi-sysroot" \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
-DLLVM_INCLUDE_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$HOME/clangd-wasi" \
-DCMAKE_CXX_FLAGS="-fno-exceptions" \
-DLLVM_TARGETS_TO_BUILD="WebAssembly" \
-DLLVM_DEFAULT_TARGET_TRIPLE="wasm32-wasi" \
../llvm-project-llvmorg-21.1.3/llvm
make -j8 clangd
When running cmake, I am stuck on the following error:
-- LLVM default target triple: wasm32-wasi
CMake Error at cmake/modules/HandleLLVMOptions.cmake:245 (MESSAGE):
Unable to determine platform
Call Stack (most recent call first):
CMakeLists.txt:1086 (include)
Unfortunately, I am not familiar enough with cmake to know what to try next to debug this problem. Any suggestions?
I'm running into trouble when trying to build the clangd language server protocol using wasi-sdk on macOS 15.
I'm using the following script:
When running cmake, I am stuck on the following error:
Unfortunately, I am not familiar enough with cmake to know what to try next to debug this problem. Any suggestions?