Skip to content

Commit ebac4cf

Browse files
eliemichelDawn LUCI CQ
authored and
Dawn LUCI CQ
committed
Fix Windows build on GitHub CI
Commit 54ad644 removed a test because the required version of Windows SDK to build Dawn is 22621. However, GitHub Action Windows runner uses SDK version 20348 by default. This PR uses [fbactions/setup-winsdk@v2](https://github.com/fbactions/setup-winsdk) to install the target version of Windows SDK, but this is not enough so we also add env variable to force SDK detection. Both env variables and cmake variable seem to be required, the former are used by DXC's `FindD3D12` script and others are for CMake's generic SDK detection. Example of successful CI run: https://github.com/eliemichel/dawn-prebuilt/actions/runs/11861028908/job/33057504211 This is an imported pull request from #23 GITHUB_PR_HEAD_SHA=dbaa1dcae87e7c5fd71d034c900eec979099388b ORIGINAL_AUTHOR=Elie Michel <[email protected]> GitOrigin-RevId: 1fbce97 Change-Id: I4b5a57c5063c3deff9f4a632ee553bc779dccbb4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/215215 Reviewed-by: Corentin Wallez <[email protected]> Commit-Queue: Corentin Wallez <[email protected]> Reviewed-by: dan sinclair <[email protected]>
1 parent b4219e7 commit ebac4cf

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: [ "main" ]
66
pull_request:
7+
workflow_dispatch:
78

89
concurrency:
910
# Use github.run_id on main branch
@@ -12,6 +13,12 @@ concurrency:
1213
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
1314
cancel-in-progress: true
1415

16+
env:
17+
# Only relevant when building on Windows, to force DXC to use the version of
18+
# the SDK that we install below with fbactions/setup-winsdk@v2
19+
WIN10_SDK_PATH: "C:/Program Files (x86)/Windows Kits/10"
20+
WIN10_SDK_VERSION: 10.0.22621.0
21+
1522
jobs:
1623
cmake:
1724
strategy:
@@ -85,6 +92,17 @@ jobs:
8592
steps:
8693
- uses: actions/checkout@v4
8794

95+
- name: Extract Windows SDK build version
96+
if: matrix.os == 'windows-latest'
97+
shell: bash
98+
run: echo "WIN10_SDK_BUILD_VERSION=$(echo $WIN10_SDK_VERSION | cut -d'.' -f3)" >> $GITHUB_ENV
99+
100+
- name: Set up Windows SDK
101+
if: matrix.os == 'windows-latest'
102+
uses: fbactions/setup-winsdk@v2
103+
with:
104+
winsdk-build-version: ${{ env.WIN10_SDK_BUILD_VERSION }}
105+
88106
- name: Set up dependencies on linux
89107
if: matrix.container == 'dockcross/manylinux_2_28-x64:latest'
90108
run: >

.github/workflows/dawn-ci.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# This file caches variables which are platform specific.
22
if (WIN32)
33
set(DAWN_USE_BUILT_DXC ON CACHE BOOL "")
4+
set(CMAKE_SYSTEM_VERSION "$ENV{WIN10_SDK_VERSION}" CACHE STRING "")
5+
set(CMAKE_WINDOWS_KITS_10_DIR "$ENV{WIN10_SDK_PATH}" CACHE STRING "")
6+
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION "$ENV{WIN10_SDK_VERSION}" CACHE STRING "")
47
endif ()
58
set(DAWN_FETCH_DEPENDENCIES ON CACHE BOOL "")
69
set(DAWN_ENABLE_INSTALL ON CACHE BOOL "")

0 commit comments

Comments
 (0)