Skip to content

Commit 26d13bd

Browse files
committed
Support compiling only for one architecture on macOS
1 parent 8a7fe51 commit 26d13bd

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

kmake/src/main.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { VSCodeExporter } from 'kmake/Exporters/VSCodeExporter';
1919
import { FreeBSDExporter } from 'kmake/Exporters/FreeBSDExporter';
2020
import { JsonExporter } from 'kmake/Exporters/JsonExporter';
2121
import { Compiler } from 'kmake/Compiler';
22+
import { Architecture } from './Architecture';
2223

2324
let _global: any = global;
2425
_global.__base = __dirname + '/';
@@ -1028,11 +1029,22 @@ export async function run(options: any, loglog: any): Promise<string> {
10281029
}
10291030
else if (isPlatform(options, Platform.OSX) || isPlatform(options, Platform.iOS) || isPlatform(options, Platform.tvOS)) {
10301031
let xcodeOptions = ['-configuration', options.debug ? 'Debug' : 'Release', '-project', solutionName + '.xcodeproj', '-quiet'];
1032+
10311033
if (options.nosigning) {
10321034
xcodeOptions.push('CODE_SIGN_IDENTITY=""');
10331035
xcodeOptions.push('CODE_SIGNING_REQUIRED=NO');
10341036
xcodeOptions.push('CODE_SIGNING_ALLOWED=NO');
10351037
}
1038+
1039+
if (Options.architecture === Architecture.Arm7 || Options.architecture === Architecture.Arm8) {
1040+
xcodeOptions.push('-arch');
1041+
xcodeOptions.push('arm64');
1042+
}
1043+
else if (Options.architecture === Architecture.X86 || Options.architecture === Architecture.X86_64) {
1044+
xcodeOptions.push('-arch');
1045+
xcodeOptions.push('x86_64');
1046+
}
1047+
10361048
make = child_process.spawn('xcodebuild', xcodeOptions, { cwd: options.to });
10371049
}
10381050
else if (isPlatform(options, Platform.Windows)

lib/kmake/main.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)