fix: wrong clang/toolchain for windows (#16191)

### What problem does this PR solve?

As title

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Haruko386
2026-06-18 17:49:55 +08:00
committed by GitHub
parent a2de7d0060
commit 1a8ee8ba61

View File

@@ -112,16 +112,16 @@ jobs:
runner: windows-latest
native_asset: native-windows-x86_64.zip
msystem: CLANG64
msys2_packages: mingw-w64-clang-x86_64-clang
cc: clang
msys2_packages: mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-lld
cc: C:/msys64/clang64/bin/clang.exe
output_ext: .exe
- goos: windows
goarch: arm64
runner: windows-11-arm
native_asset: native-windows-aarch64.zip
msystem: CLANGARM64
msys2_packages: mingw-w64-clang-aarch64-clang
cc: clang
msys2_packages: mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-lld
cc: C:/msys64/clangarm64/bin/clang.exe
output_ext: .exe
runs-on: ${{ matrix.runner }}
env:
@@ -287,13 +287,21 @@ jobs:
Write-Host "Building ${{ matrix.goos }}/${{ matrix.goarch }} -> $output"
$officeOxidePrefix = $env:OFFICE_OXIDE_PREFIX -replace "\\", "/"
$cc = "${{ matrix.cc }}"
if (-not (Test-Path $cc)) {
Write-Error "C compiler does not exist: $cc"
exit 1
}
$env:CGO_ENABLED = "1"
$env:CC = $cc
$env:CGO_CFLAGS = "-I${officeOxidePrefix}/include -I${officeOxidePrefix}/include/office_oxide_c"
$env:CGO_LDFLAGS = "${officeOxidePrefix}/lib/office_oxide.lib -lws2_32 -lntdll -luserenv"
$env:GOOS = "${{ matrix.goos }}"
$env:GOARCH = "${{ matrix.goarch }}"
Write-Host "CC: $env:CC"
& $env:CC --version
Write-Host "office_oxide prefix: $officeOxidePrefix"
Write-Host "CGO_CFLAGS: $env:CGO_CFLAGS"
Write-Host "CGO_LDFLAGS: $env:CGO_LDFLAGS"