-
Notifications
You must be signed in to change notification settings - Fork 43
113 lines (112 loc) · 4.23 KB
/
build-mesa.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Build Mesa
on:
push:
workflow_dispatch:
inputs:
mesa-branch:
description: 'Branch of Mesa to use'
required: True
default: 24.3
type: string
llvm-branch:
description: 'Branch of LLVM to use'
required: True
default: release/19.x
type: string
jobs:
build:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest, windows-2022]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false
- name: Setup Python environment
shell: bash
if: ${{ matrix.os != 'windows-2022' }}
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install meson packaging pyyaml mako
- name: Install required packages (Ubuntu)
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: |
sudo apt install -y libdrm-dev libxcb1-dev libxrandr-dev libxcb-randr0-dev \
libx11-xcb-dev libxcb-dri3-dev libxcb-present-dev \
libxcb-shm0-dev libxshmfence-dev
- name: Install required packages (Windows)
if: ${{ matrix.os == 'windows-2022' }}
run: |
pip install mako meson pyyaml
choco install winflexbison pkgconfiglite
- name: Setup Ninja
uses: ./.github/actions/setup-ninja
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
variant: sccache
key: ${{ matrix.os }}-mesa
- name: Fetch LLVM
run: |
git clone -b ${{ inputs.llvm-branch }} --depth 1 https://github.com/llvm/llvm-project.git llvm-project
- name: Build LLVM (Windows)
if: ${{ matrix.os == 'windows-2022' }}
run: |
cd llvm-project/llvm
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="AArch64;X86"
ninja
ninja install
- name: Build LLVM (non-Windows)
if: ${{ matrix.os != 'windows-2022' }}
run: |
cd llvm-project/llvm
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="AArch64;X86" -DBUILD_SHARED_LIBS=ON
ninja
sudo $(which ninja) install
- name: Fetch Mesa
run: |
git clone -b ${{ inputs.mesa-branch }} --depth 1 https://gitlab.freedesktop.org/mesa/mesa.git mesa
- name: Compose configuration options
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
echo "platforms=windows" >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "platforms=macos" >> $GITHUB_ENV
else
echo "platforms=x11" >> $GITHUB_ENV
fi
- name: Configure
if: ${{ matrix.os != 'windows-2022' }}
shell: bash
run: |
if [ "$RUNNER_OS" != "Windows" ]; then
source venv/bin/activate
fi
pip list
cd mesa
meson setup -Dcpp_rtti=false -Dvulkan-drivers=swrast -Dintel-clc=system -Dopengl=false -Dgles1=false -Dgles2=false -Dgallium-drivers=llvmpipe -Dplatforms=${{ env.platforms }} build
# FIXME separate configure step necessary because using bash selects GNU link.exe
- name: Configure (Windows)
if: ${{ matrix.os == 'windows-2022' }}
# FIXME d3d12 gallium driver enabled to pull DirectX-Headers as dep. Mesa should do it on a Windows platform when building a Vulkan driver.
run: |
pip list
cd mesa
meson setup -Dvulkan-drivers=swrast -Dintel-clc=system -Dopengl=false -Dgles1=false -Dgles2=false -Dgallium-drivers='llvmpipe,d3d12' -Dplatforms=${{ env.platforms }} build
- name: Build
run: |
ninja -C mesa/build
- uses: actions/upload-artifact@v4
with:
name: mesa-${{ runner.os }}
path: ${{ github.workspace }}/mesa/build/src/gallium/targets/lavapipe