Skip to content

Commit ee64432

Browse files
committed
fix: don't try to build OS X x64
1 parent 63c2529 commit ee64432

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ dist/
1010
/typings/browser/
1111
/typings/browser.d.ts
1212
/typings/main.d.ts
13-
.DS_Store
13+
.DS_Store
14+
.idea/shelf/

src/builder.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,13 @@ export function normalizeOptions(args: CliOptions): BuildOptions {
8989
}
9090

9191
if (types.length === 0) {
92-
for (let arch of commonArch()) {
93-
archToType.set(arch, [])
92+
if (platform === Platform.OSX) {
93+
archToType.set(Arch.x64, [])
94+
}
95+
else {
96+
for (let arch of commonArch()) {
97+
archToType.set(arch, [])
98+
}
9499
}
95100
return
96101
}

src/metadata.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,10 @@ export class Platform {
399399

400400
createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>> {
401401
const archToType = new Map()
402+
if (this === Platform.OSX) {
403+
archs = [Arch.x64]
404+
}
405+
402406
for (let arch of (archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs)) {
403407
archToType.set(arch, type == null ? [] : (Array.isArray(type) ? type : [type]))
404408
}

test/src/BuildTest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ test("cli", () => {
2929
}
3030

3131
assertThat(parse("--platform osx")).isEqualTo(expected({targets: Platform.OSX.createTarget()}))
32+
assertThat(parse("-owl --x64 --ia32")).isEqualTo(expected({targets: new Map([...Platform.OSX.createTarget(null, Arch.x64), ...Platform.WINDOWS.createTarget(null, Arch.x64, Arch.ia32), ...Platform.LINUX.createTarget(null, Arch.x64, Arch.ia32)])}))
3233
assertThat(parse("--osx")).isEqualTo(expected({targets: Platform.OSX.createTarget()}))
3334
assertThat(parse("--arch x64")).isEqualTo(expected({targets: Platform.current().createTarget(null, Arch.x64)}))
3435
assertThat(parse("--ia32 --x64")).isEqualTo(expected({targets: Platform.current().createTarget(null, Arch.x64, Arch.ia32)}))

0 commit comments

Comments
 (0)