Skip to content

Commit 63eef37

Browse files
committed
Change Host to Build and Target to Host
This matches the rest of the workflow's naming convention.
1 parent 6c8f7d1 commit 63eef37

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

.github/actions/setup-build/action.yml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ inputs:
1515
default: false
1616
required: false
1717
type: boolean
18-
target-arch:
19-
description: The target architecture, "x86", "amd64" or "arm64". Defaults to the host architecture.
18+
host-arch:
19+
description: |
20+
The compiler's host architecture, "x86", "amd64" or "arm64". Defaults to the build
21+
architecture. (a.k.a. the current runner's architecture).
22+
This is the target architecture for the Visual Studio Developer Environment.
2023
required: false
2124
type: string
2225

@@ -35,20 +38,20 @@ runs:
3538
shell: pwsh
3639
run: |
3740
if ($IsWindows) {
38-
$HostOS = "windows"
41+
$BuildOS = "windows"
3942
} elseif ($IsMacOS) {
40-
$HostOS = "mac"
43+
$BuildOS = "macosx"
4144
} else {
4245
Write-Output "::error::Unsupported host OS."
4346
exit 1
4447
}
4548
4649
$Arch = ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture).ToString()
4750
switch ($Arch) {
48-
"X64" { $HostArch = "amd64" }
49-
"Arm64" { $HostArch = "arm64" }
51+
"X64" { $BuildArch = "amd64" }
52+
"Arm64" { $BuildArch = "arm64" }
5053
default {
51-
Write-Output "::error::Unsupported host architecture: `"$HostArch`""
54+
Write-Output "::error::Unsupported host architecture: `"$BuildArch`""
5255
exit 1
5356
}
5457
}
@@ -79,32 +82,32 @@ runs:
7982
}
8083
8184
if ("${{ inputs.setup-vs-dev-env }}" -eq "true") {
82-
switch ("${{ inputs.target-arch }}") {
83-
"x86" { $TargetArch = "x86" }
84-
"amd64" { $TargetArch = "amd64" }
85-
"arm64" { $TargetArch = "arm64" }
86-
"" { $TargetArch = $HostArch }
85+
switch ("${{ inputs.host-arch }}") {
86+
"x86" { $HostArch = "x86" }
87+
"amd64" { $HostArch = "amd64" }
88+
"arm64" { $HostArch = "arm64" }
89+
"" { $HostArch = $BuildArch }
8790
default {
88-
Write-Output "::error::Unsupported target architecture: `"${{ inputs.target-arch }}`""
91+
Write-Output "::error::Unsupported host architecture: `"${{ inputs.host-arch }}`""
8992
exit 1
9093
}
9194
}
9295
} else {
93-
$TargetArch = $HostArch
96+
$HostArch = $BuildArch
9497
}
9598
96-
Write-Output "ℹ️ Host OS: $HostOS"
99+
Write-Output "ℹ️ Build OS: $BuildOS"
100+
Write-Output "ℹ️ Build architecture: $BuildArch"
97101
Write-Output "ℹ️ Host architecture: $HostArch"
98-
Write-Output "ℹ️ Target architecture: $TargetArch"
99102
100103
@"
101-
host-os=$HostOS
104+
build-os=$BuildOS
105+
build-arch=$BuildArch
102106
host-arch=$HostArch
103-
target-arch=$TargetArch
104107
"@ | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
105108
106109
- name: Install Windows SDK version ${{ inputs.windows-sdk-version }}
107-
if: steps.sanitize-input.outputs.host-os == 'windows' && inputs.windows-sdk-version != ''
110+
if: steps.sanitize-input.outputs.build-os == 'windows' && inputs.windows-sdk-version != ''
108111
shell: pwsh
109112
run: |
110113
$WinSdkVersionString = "${{ inputs.windows-sdk-version }}"
@@ -168,7 +171,7 @@ runs:
168171
}
169172
170173
- name: Install Windows MSVC version ${{ inputs.msvc-version }}
171-
if: steps.sanitize-input.outputs.host-os == 'windows' && inputs.msvc-version != ''
174+
if: steps.sanitize-input.outputs.build-os == 'windows' && inputs.msvc-version != ''
172175
id: setup-msvc
173176
shell: pwsh
174177
run: |
@@ -232,10 +235,10 @@ runs:
232235
}
233236
234237
- name: Setup Visual Studio Developer Environment
235-
if: steps.sanitize-input.outputs.host-os == 'windows' && inputs.setup-vs-dev-env == 'true'
238+
if: steps.sanitize-input.outputs.build-os == 'windows' && inputs.setup-vs-dev-env == 'true'
236239
uses: compnerd/gha-setup-vsdevenv@5eb3eae1490d4f7875d574c4973539f69109700d # main
237240
with:
238-
host_arch: ${{ steps.sanitize-input.outputs.host-arch }}
239-
arch: ${{ steps.sanitize-input.outputs.target-arch }}
241+
host_arch: ${{ steps.sanitize-input.outputs.build-arch }}
242+
arch: ${{ steps.sanitize-input.outputs.host-arch }}
240243
winsdk: ${{ inputs.windows-sdk-version }}
241244
toolset_version: ${{ inputs.msvc-version }}

0 commit comments

Comments
 (0)