Support architecture parameter

This commit is contained in:
dcvz 2023-11-07 10:09:55 +01:00
parent 7afabe74da
commit 920bcc320b
3 changed files with 22 additions and 0 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -72,6 +72,26 @@ class SetupMac {
return '';
}
private static getArchitectureParameters(): string[] {
const architectureArgument = [];
// @ts-ignore
const process = require('process');
switch (process.arch) {
case 'x64':
architectureArgument.push('--architecture', 'x86_64');
break;
case 'arm64':
architectureArgument.push('--architecture', 'arm64');
break;
default:
throw new Error(`Unsupported architecture: ${process.arch}.`);
}
return architectureArgument;
}
private static getModuleParametersForTargetPlatform(targetPlatform: string): string[] {
const moduleArgument = [];
switch (targetPlatform) {
@ -111,6 +131,7 @@ class SetupMac {
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
const architectureArguments = SetupMac.getArchitectureParameters();
const execArguments: string[] = [
'--',
@ -119,6 +140,7 @@ class SetupMac {
...['--version', buildParameters.editorVersion],
...['--changeset', unityChangeset.changeset],
...moduleArguments,
...architectureArguments,
'--childModules',
];