From 210cf3b4f49819edaf8302b79921cffb68f6b897 Mon Sep 17 00:00:00 2001 From: nessi Date: Tue, 17 Mar 2026 19:39:51 +0100 Subject: [PATCH] fix: add clang-cl wrapper script and update Windows build to ensure clang availability Add clang-cl wrapper script that invokes clang in MSVC-compatible mode with availability check and helpful error message. Update Linux Windows build script to make clang-cl wrapper executable and include scripts directory in PATH for both cargo-xwin and clang-cl resolution. --- desktop-client/package.json | 2 +- desktop-client/scripts/clang-cl | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 desktop-client/scripts/clang-cl diff --git a/desktop-client/package.json b/desktop-client/package.json index d4a8e94..539f53b 100644 --- a/desktop-client/package.json +++ b/desktop-client/package.json @@ -10,7 +10,7 @@ "tauri:build": "tauri build", "helper:windows-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-pc-windows-msvc", "helper:macos-arm64": "bash ./scripts/build-tunnel-helper.sh aarch64-apple-darwin", - "tauri:build:windows-x64:linux": "chmod +x ./scripts/cargo-xwin && PATH=\"$PWD/scripts:$PATH\" XWIN_ARCH=x86_64 tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --config src-tauri/tauri.windows.conf.json" + "tauri:build:windows-x64:linux": "chmod +x ./scripts/cargo-xwin ./scripts/clang-cl && PATH=\"$PWD/scripts:$PATH\" XWIN_ARCH=x86_64 tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --config src-tauri/tauri.windows.conf.json" }, "dependencies": { "@tauri-apps/api": "2.10.1", diff --git a/desktop-client/scripts/clang-cl b/desktop-client/scripts/clang-cl new file mode 100644 index 0000000..a99280d --- /dev/null +++ b/desktop-client/scripts/clang-cl @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -eu + +if ! command -v clang >/dev/null 2>&1; then + echo "clang is required for Windows cross-builds on Linux." + echo "Install it with:" + echo " sudo apt update" + echo " sudo apt install -y clang" + exit 1 +fi + +exec clang --driver-mode=cl "$@"