Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows build on GitHub CI #23

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [ "main" ]
pull_request:
workflow_dispatch:

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

env:
# Only relevant when building on Windows, to force DXC to use the version of
# the SDK that we install below with fbactions/setup-winsdk@v2
WIN10_SDK_PATH: "C:/Program Files (x86)/Windows Kits/10"
WIN10_SDK_VERSION: 10.0.22621.0

jobs:
cmake:
strategy:
Expand Down Expand Up @@ -85,6 +92,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Extract Windows SDK build version
if: matrix.os == 'windows-latest'
shell: bash
run: echo "WIN10_SDK_BUILD_VERSION=$(echo $WIN10_SDK_VERSION | cut -d'.' -f3)" >> $GITHUB_ENV

- name: Set up Windows SDK
if: matrix.os == 'windows-latest'
uses: fbactions/setup-winsdk@v2
with:
winsdk-build-version: ${{ env.WIN10_SDK_BUILD_VERSION }}

- name: Set up dependencies on linux
if: matrix.container == 'dockcross/manylinux_2_28-x64:latest'
run: >
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dawn-ci.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This file caches variables which are platform specific.
if (WIN32)
set(DAWN_USE_BUILT_DXC ON CACHE BOOL "")
set(CMAKE_SYSTEM_VERSION "$ENV{WIN10_SDK_VERSION}" CACHE STRING "")
set(CMAKE_WINDOWS_KITS_10_DIR "$ENV{WIN10_SDK_PATH}" CACHE STRING "")
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION "$ENV{WIN10_SDK_VERSION}" CACHE STRING "")
endif ()
set(DAWN_FETCH_DEPENDENCIES ON CACHE BOOL "")
set(DAWN_ENABLE_INSTALL ON CACHE BOOL "")
Expand Down
Loading