Refactor host tool build

This commit is contained in:
Luke Street
2026-06-03 12:16:03 -06:00
parent 1fd4bc76a3
commit 03c49787b5
+24 -28
View File
@@ -27,12 +27,12 @@ jobs:
- os: windows-latest
tarball: dawn-windows-amd64.tar.gz
msvc_arch: x64
windows_sdk_arch: x64
sdk_arch: x64
- os: windows-latest
tarball: dawn-windows-arm64.tar.gz
msvc_arch: amd64_arm64
windows_sdk_arch: arm64
dxc_tablegen_arch: x64
sdk_arch: arm64
host_tool_arch: x64
- os: ubuntu-24.04
tarball: dawn-linux-x86_64.tar.gz
- os: ubuntu-24.04-arm
@@ -85,14 +85,21 @@ jobs:
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Setup MSVC for host DXC tablegen
if: matrix.dxc_tablegen_arch
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwayland-dev libxkbcommon-dev libxrandr-dev \
libxinerama-dev libxcursor-dev mesa-common-dev libx11-xcb-dev
- name: Setup MSVC for host tools
if: matrix.host_tool_arch
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: ${{ matrix.dxc_tablegen_arch }}
arch: ${{ matrix.host_tool_arch }}
- name: Build host DXC tablegen
if: matrix.dxc_tablegen_arch
if: matrix.host_tool_arch
shell: pwsh
run: |
cmake -S dawn -B host-dxc-tablegen -G Ninja `
@@ -103,19 +110,18 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
cmake --build host-dxc-tablegen --target llvm-tblgen clang-tblgen --config Release
- name: Build host protoc
if: matrix.platform || matrix.host_tool_arch
run: |
cmake -S dawn -B host-protoc -G Ninja -C dawn/.github/workflows/dawn-ci.cmake -C .github/workflows/dawn-ci.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
cmake --build host-protoc --target protoc --config Release
- name: Setup MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: ${{ matrix.msvc_arch }}
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwayland-dev libxkbcommon-dev libxrandr-dev \
libxinerama-dev libxcursor-dev mesa-common-dev libx11-xcb-dev
- name: Setup Android SDK
if: matrix.platform == 'Android'
uses: android-actions/setup-android@v4
@@ -124,24 +130,14 @@ jobs:
if: matrix.platform == 'Android'
run: sdkmanager "ndk;$ANDROID_NDK_VERSION"
- name: Build host protoc
if: matrix.platform
run: |
cmake -S dawn -B host-protoc -G Ninja \
-C dawn/.github/workflows/dawn-ci.cmake \
-C .github/workflows/dawn-ci.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
cmake --build host-protoc --target protoc --config Release
- name: Configure
run: >-
cmake -S dawn -B build -G Ninja
${{ matrix.platform && format('-DCMAKE_SYSTEM_NAME={0}', matrix.platform) || '' }}
${{ matrix.extra_cmake_args }}
${{ matrix.dxc_tablegen_arch && format('-DLLVM_TABLEGEN={0}/host-dxc-tablegen/third_party/directx-shader-compiler/src/bin/llvm-tblgen.exe', github.workspace) || '' }}
${{ matrix.dxc_tablegen_arch && format('-DCLANG_TABLEGEN={0}/host-dxc-tablegen/third_party/directx-shader-compiler/src/bin/clang-tblgen.exe', github.workspace) || '' }}
${{ matrix.host_tool_arch && format('-DLLVM_TABLEGEN={0}/host-dxc-tablegen/third_party/directx-shader-compiler/src/bin/llvm-tblgen.exe', github.workspace) || '' }}
${{ matrix.host_tool_arch && format('-DCLANG_TABLEGEN={0}/host-dxc-tablegen/third_party/directx-shader-compiler/src/bin/clang-tblgen.exe', github.workspace) || '' }}
${{ matrix.host_tool_arch && format('-DWITH_PROTOC={0}/host-protoc/protoc.exe', github.workspace) || '' }}
-C dawn/.github/workflows/dawn-ci.cmake
-C .github/workflows/dawn-ci.cmake
-DCMAKE_BUILD_TYPE=Release
@@ -168,7 +164,7 @@ jobs:
cp build/dxcompiler.dll install/bin/
# Dawn's CopyWindowsSDKDLL.cmake hardcodes the x64 SDK path, so on
# ARM64 build/dxil.dll is still x64. Source it from the SDK directly.
cp "${WindowsSdkDir}bin/${WindowsSDKVersion}${{ matrix.windows_sdk_arch }}/dxil.dll" install/bin/
cp "${WindowsSdkDir}bin/${WindowsSDKVersion}${{ matrix.sdk_arch }}/dxil.dll" install/bin/
- name: Package
run: tar -czf ${{ matrix.tarball }} -C install .