Skip to content

Commit 1a256b9

Browse files
committed
fix: detect LLVM dynamically via llvm-config, upload examples instead of benchmarks
1 parent 82ee89b commit 1a256b9

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,25 @@ jobs:
5353
if: matrix.os == 'windows-latest'
5454
shell: pwsh
5555
run: |
56-
# LLVM is pre-installed on windows-latest runners; just export the path
57-
$llvmDir = "C:\Program Files\LLVM\lib\cmake\llvm"
58-
if (Test-Path $llvmDir) {
59-
echo "LLVM_DIR=$llvmDir" >> $env:GITHUB_ENV
60-
Write-Host "Using pre-installed LLVM at $llvmDir"
56+
# Use llvm-config to find the cmake dir dynamically (LLVM is pre-installed on runner)
57+
$llvmConfig = (Get-Command llvm-config -ErrorAction SilentlyContinue)?.Source
58+
if ($llvmConfig) {
59+
$llvmCmakeDir = & llvm-config --cmakedir
60+
Write-Host "Found LLVM cmake dir: $llvmCmakeDir"
61+
echo "LLVM_DIR=$llvmCmakeDir" >> $env:GITHUB_ENV
6162
} else {
62-
Write-Warning "LLVM cmake dir not found at expected path; CMake will search automatically"
63+
# Fallback: check common install paths
64+
$candidates = @(
65+
"C:\Program Files\LLVM\lib\cmake\llvm",
66+
"C:\ProgramData\chocolatey\lib\llvm\tools\llvm\lib\cmake\llvm"
67+
)
68+
foreach ($p in $candidates) {
69+
if (Test-Path $p) {
70+
Write-Host "Found LLVM at fallback: $p"
71+
echo "LLVM_DIR=$p" >> $env:GITHUB_ENV
72+
break
73+
}
74+
}
6375
}
6476
6577
@@ -120,4 +132,4 @@ jobs:
120132
# For Linux/Mac, it still uploads the single binary.
121133
path: |
122134
${{ matrix.bin_path }}
123-
benchmarks/
135+
examples/

0 commit comments

Comments
 (0)