Architecture aliases: Win32 & Win64 (#29)

By a public request, let's support aliases for architecture parameters.
Treat "arch: Win32" as "x86" and "Win64" as "x64".

Test this on CI just in case x86 breaks or something.
This commit is contained in:
Alexei Lozovsky
2021-03-07 15:23:48 +09:00
committed by GitHub
parent 754fb4dc40
commit 6f493f9a67
3 changed files with 32 additions and 2 deletions
+12 -1
View File
@@ -77,12 +77,23 @@ function main() {
// Add standard location of "vswhere" to PATH, in case it's not there.
process.env.PATH += path.delimiter + VSWHERE_PATH
const arch = core.getInput('arch')
var arch = core.getInput('arch')
const sdk = core.getInput('sdk')
const toolset = core.getInput('toolset')
const uwp = core.getInput('uwp')
const spectre = core.getInput('spectre')
// There are all sorts of way the architectures are called. In addition to
// values supported by Microsoft Visual C++, recognize some common aliases.
let arch_aliases = {
"win32": "x86",
"win64": "x64",
}
// Ignore case when matching as that's what humans expect.
if (arch.toLowerCase() in arch_aliases) {
arch = arch_aliases[arch.toLowerCase()]
}
// Due to the way Microsoft Visual C++ is configured, we have to resort to the following hack:
// Call the configuration batch file and then output *all* the environment variables.