feat(ci): enhance Windows SDK checks in CI and release workflows
- Added checks to ensure Windows SDK environment variables are set, providing warnings if they are not. - Included a step to verify the presence of kernel32.lib, improving diagnostics for Windows builds. Benefits: - Increases the robustness of the CI and release workflows by ensuring necessary SDK components are available. - Enhances build reliability on Windows by proactively identifying potential issues with the SDK setup.
This commit is contained in:
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@@ -220,6 +220,12 @@ jobs:
|
||||
}
|
||||
}
|
||||
Write-Host "MSVC developer environment variables exported (selected set)"
|
||||
|
||||
- name: Ensure MSVC Dev Cmd (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Diagnose vcpkg (Windows)
|
||||
if: runner.os == 'Windows' && (steps.vcpkg.outcome == 'failure' || steps.vcpkg.outcome == 'success')
|
||||
@@ -362,6 +368,17 @@ jobs:
|
||||
}
|
||||
Write-Host "Using vcpkg toolchain: $env:CMAKE_TOOLCHAIN_FILE"
|
||||
|
||||
if (-not $env:WindowsSdkDir -or -not $env:WindowsSdkVersion) {
|
||||
Write-Host "::warning::Windows SDK environment variables not set (WindowsSdkDir/WindowsSdkVersion)"
|
||||
} else {
|
||||
$kernelLib = Join-Path $env:WindowsSdkDir ("Lib/{0}/um/x64/kernel32.lib" -f $env:WindowsSdkVersion.TrimEnd('\'))
|
||||
if (Test-Path $kernelLib) {
|
||||
Write-Host "Found Windows SDK kernel32.lib at: $kernelLib"
|
||||
} else {
|
||||
Write-Host "::warning::kernel32.lib not found at expected path: $kernelLib"
|
||||
}
|
||||
}
|
||||
|
||||
$linker = "link.exe"
|
||||
if ($env:MSVC_LINK_PATH -and (Test-Path $env:MSVC_LINK_PATH)) {
|
||||
$linker = $env:MSVC_LINK_PATH
|
||||
|
||||
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
@@ -295,6 +295,12 @@ jobs:
|
||||
}
|
||||
Write-Host "MSVC developer environment variables exported (selected set)"
|
||||
|
||||
- name: "Ensure MSVC Dev Cmd (Windows)"
|
||||
if: runner.os == 'Windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: "Free Disk Space (Linux)"
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
@@ -372,6 +378,17 @@ jobs:
|
||||
}
|
||||
Write-Host "Using vcpkg toolchain: $env:CMAKE_TOOLCHAIN_FILE"
|
||||
|
||||
if (-not $env:WindowsSdkDir -or -not $env:WindowsSdkVersion) {
|
||||
Write-Host "::warning::Windows SDK environment variables not set (WindowsSdkDir/WindowsSdkVersion)"
|
||||
} else {
|
||||
$kernelLib = Join-Path $env:WindowsSdkDir ("Lib/{0}/um/x64/kernel32.lib" -f $env:WindowsSdkVersion.TrimEnd('\'))
|
||||
if (Test-Path $kernelLib) {
|
||||
Write-Host "Found Windows SDK kernel32.lib at: $kernelLib"
|
||||
} else {
|
||||
Write-Host "::warning::kernel32.lib not found at expected path: $kernelLib"
|
||||
}
|
||||
}
|
||||
|
||||
$linker = "link.exe"
|
||||
if ($env:MSVC_LINK_PATH -and (Test-Path $env:MSVC_LINK_PATH)) {
|
||||
$linker = $env:MSVC_LINK_PATH
|
||||
|
||||
Reference in New Issue
Block a user