Support architecture parameter
parent
7afabe74da
commit
920bcc320b
|
@ -7197,6 +7197,22 @@ class SetupMac {
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
static getArchitectureParameters() {
|
||||||
|
const architectureArgument = [];
|
||||||
|
// @ts-ignore
|
||||||
|
const process = __nccwpck_require__(77282);
|
||||||
|
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;
|
||||||
|
}
|
||||||
static getModuleParametersForTargetPlatform(targetPlatform) {
|
static getModuleParametersForTargetPlatform(targetPlatform) {
|
||||||
const moduleArgument = [];
|
const moduleArgument = [];
|
||||||
switch (targetPlatform) {
|
switch (targetPlatform) {
|
||||||
|
@ -7232,6 +7248,7 @@ class SetupMac {
|
||||||
}
|
}
|
||||||
const unityChangeset = await (0, unity_changeset_1.getUnityChangeset)(buildParameters.editorVersion);
|
const unityChangeset = await (0, unity_changeset_1.getUnityChangeset)(buildParameters.editorVersion);
|
||||||
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
|
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
|
||||||
|
const architectureArguments = SetupMac.getArchitectureParameters();
|
||||||
const execArguments = [
|
const execArguments = [
|
||||||
'--',
|
'--',
|
||||||
'--headless',
|
'--headless',
|
||||||
|
@ -7239,6 +7256,7 @@ class SetupMac {
|
||||||
...['--version', buildParameters.editorVersion],
|
...['--version', buildParameters.editorVersion],
|
||||||
...['--changeset', unityChangeset.changeset],
|
...['--changeset', unityChangeset.changeset],
|
||||||
...moduleArguments,
|
...moduleArguments,
|
||||||
|
...architectureArguments,
|
||||||
'--childModules',
|
'--childModules',
|
||||||
];
|
];
|
||||||
// Ignoring return code because the log seems to overflow the internal buffer which triggers
|
// Ignoring return code because the log seems to overflow the internal buffer which triggers
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -72,6 +72,26 @@ class SetupMac {
|
||||||
return '';
|
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[] {
|
private static getModuleParametersForTargetPlatform(targetPlatform: string): string[] {
|
||||||
const moduleArgument = [];
|
const moduleArgument = [];
|
||||||
switch (targetPlatform) {
|
switch (targetPlatform) {
|
||||||
|
@ -111,6 +131,7 @@ class SetupMac {
|
||||||
|
|
||||||
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
|
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
|
||||||
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
|
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
|
||||||
|
const architectureArguments = SetupMac.getArchitectureParameters();
|
||||||
|
|
||||||
const execArguments: string[] = [
|
const execArguments: string[] = [
|
||||||
'--',
|
'--',
|
||||||
|
@ -119,6 +140,7 @@ class SetupMac {
|
||||||
...['--version', buildParameters.editorVersion],
|
...['--version', buildParameters.editorVersion],
|
||||||
...['--changeset', unityChangeset.changeset],
|
...['--changeset', unityChangeset.changeset],
|
||||||
...moduleArguments,
|
...moduleArguments,
|
||||||
|
...architectureArguments,
|
||||||
'--childModules',
|
'--childModules',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue