Skip to content

Commit 57abb83

Browse files
committed
fix: support boolean in uwp and spectre
1 parent c55599b commit 57abb83

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ inputs:
88
description: Windows SDK number to build for
99
spectre:
1010
description: Enable Specre mitigations
11+
default: "false"
1112
toolset:
1213
description: VC++ compiler toolset version
1314
uwp:
1415
description: Build for Universal Windows Platform
16+
default: "false"
1517
vsversion:
1618
description: The Visual Studio version to use. This can be the version number (e.g. 16.0 for 2019) or the year (e.g. "2019").
1719
runs:

lib.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ export function findVcvarsall(version: string): string
3232
* @param {string} arch - Target architecture
3333
* @param {string} sdk - Windows SDK number to build for
3434
* @param {string} toolset - VC++ compiler toolset version
35-
* @param {'true' | 'false'} uwp - Build for Universal Windows Platform
36-
* @param {'true' | 'false'} spectre - Enable Spectre mitigations
35+
* @param {boolean | 'true' | 'false'} uwp - Build for Universal Windows Platform
36+
* @param {boolean | 'true' | 'false'} spectre - Enable Spectre mitigations
3737
* @param {string} vsversion - The Visual Studio version to use. This can be the version number (e.g. 16.0 for 2019) or the year (e.g. "2019").
3838
*/
3939
export function setupMSVCDevCmd(
4040
arch: string,
4141
sdk?: string,
4242
toolset?: string,
43-
uwp?: 'true' | 'false',
44-
spectre?: 'true' | 'false',
43+
uwp?: boolean | 'true' | 'false',
44+
spectre?: boolean | 'true' | 'false',
4545
vsversion?: string,
4646
)

lib.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ function filterPathValue(path) {
146146
* @param {string} arch - Target architecture
147147
* @param {string} sdk - Windows SDK number to build for
148148
* @param {string} toolset - VC++ compiler toolset version
149-
* @param {'true' | 'false'} uwp - Build for Universal Windows Platform
150-
* @param {'true' | 'false'} spectre - Enable Spectre mitigations
149+
* @param {boolean | 'true' | 'false'} uwp - Build for Universal Windows Platform
150+
* @param {boolean | 'true' | 'false'} spectre - Enable Spectre mitigations
151151
* @param {string} vsversion - The Visual Studio version to use. This can be the version number (e.g. 16.0 for 2019) or the year (e.g. "2019").
152152
*/
153153
function setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre, vsversion) {
@@ -176,7 +176,8 @@ function setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre, vsversion) {
176176
// Call the configuration batch file and then output *all* the environment variables.
177177

178178
var args = [arch]
179-
if (uwp == 'true') {
179+
180+
if (uwp && JSON.parse(uwp) === true) {
180181
args.push('uwp')
181182
}
182183
if (sdk) {
@@ -185,7 +186,7 @@ function setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre, vsversion) {
185186
if (toolset) {
186187
args.push(`-vcvars_ver=${toolset}`)
187188
}
188-
if (spectre == 'true') {
189+
if (spectre && JSON.parse(spectre) === true) {
189190
args.push('-vcvars_spectre_libs=spectre')
190191
}
191192

0 commit comments

Comments
 (0)