Skip to content

Commit 339a803

Browse files
committed
ci: WIP actions build for LLVM on x86_64-unknown-linux-gnu
1 parent e33d219 commit 339a803

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copied from github.com/llvm/llvm-project Actions
2+
3+
env:
4+
LLVM_REF: llvmorg-20.1.8
5+
6+
name: "Build LLVM for Linux"
7+
on:
8+
workflow_dispatch:
9+
workflow_call:
10+
11+
jobs:
12+
build-llvm-windows:
13+
name: "Build LLVM x86_64-unknown-linux-gnu"
14+
runs-on: ubuntu-22.04
15+
env:
16+
LLVM_INSTALL_PATH: ${{ github.workspace }}/llvm-install
17+
LLVM_BUILD_PATH: ${{ github.workspace }}/llvm-build
18+
steps:
19+
- name: cache
20+
id: cache
21+
uses: actions/cache@v4.2.2
22+
with:
23+
path: |
24+
${{ env.LLVM_INSTALL_PATH }}
25+
key: llvm-built-${{ env.LLVM_REF }}
26+
- name: Fetch LLVM sources
27+
if: steps.cache.outputs.cache-hit != 'true'
28+
uses: actions/checkout@v4
29+
with:
30+
repository: llvm/llvm-project
31+
ref: ${{ env.LLVM_REF }}
32+
fetch-depth: 2
33+
- name: install llvm-19
34+
id: setup
35+
run: sudo apt install clang-19
36+
- name: Configure LLVM
37+
if: steps.cache.outputs.cache-hit != 'true'
38+
shell: bash
39+
run: |
40+
cmake \
41+
-G "Ninja" \
42+
-S llvm \
43+
-B $LLVM_BUILD_PATH \
44+
-DLLVM_BUILD_LLVM_C_DYLIB=ON \
45+
-DLLVM_BUILD_LLVM_DYLIB=On \
46+
-DLLVM_LINK_LLVM_DYLIB=On \
47+
-DCMAKE_INSTALL_PREFIX=$LLVM_INSTALL_PATH \
48+
-DCMAKE_BUILD_TYPE=Release \
49+
-DLLVM_ENABLE_ASSERTIONS=On \
50+
-DCMAKE_C_COMPILER=/usr/bin/clang-19
51+
-DCMAKE_CXX_COMPILER=/usr/bin/clang-19
52+
-DLLVM_TARGETS_TO_BUILD=X86 \
53+
-DLLVM_ENABLE_DIA_SDK=OFF \
54+
-DLLVM_ENABLE_LIBXML2=OFF \
55+
-DLLVM_INCLUDE_TESTS=OFF \
56+
-DPYTHON_EXECUTABLE="$(where python.exe | head -1)" \
57+
-DLLVM_ENABLE_ZSTD=OFF \
58+
-DLLVM_ENABLE_PROJECTS="llvm;lld"
59+
- name: Build LLVM
60+
if: steps.cache.outputs.cache-hit != 'true'
61+
run: |
62+
cd "${{ env.LLVM_BUILD_PATH }}"
63+
ninja
64+
ninja install
65+
- name: Collect artifacts
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: llvm-linux-gnu-x86_64
69+
path: |
70+
${{ env.LLVM_INSTALL_PATH }}

0 commit comments

Comments
 (0)