Skip to content

Commit 24e762f

Browse files
committed
fix: set generator platform only for visual studio
1 parent fa55b71 commit 24e762f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/argumentBuilder.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ export class ArgumentBuilder {
119119
`Failed to setup MSVC variables for ${this.config.arch}: ${e}. Relying on CMake generator platform.`,
120120
)
121121
}
122-
// set the CMake generator platform to the target architecture
123-
retVal.push(["CMAKE_GENERATOR_PLATFORM", cmakeArch])
122+
if (this.config.generatorToUse.includes("Visual Studio")) {
123+
// set the CMake generator platform to the target architecture
124+
retVal.push(["CMAKE_GENERATOR_PLATFORM", cmakeArch])
125+
}
124126
}
125127
}
126128

test/zeromq.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { existsSync, readJson } from "fs-extra"
44
import { assert, expect } from "vitest"
55
import which from "which"
66
import { parseArgs } from "../src/args.js"
7-
import { getCMakeArchitecture } from "../src/argumentBuilder.js"
87
import { build } from "../src/build.js"
98
import type { BuildConfiguration } from "../src/config.js"
109

@@ -123,9 +122,8 @@ async function testZeromqBuildResults(config: BuildConfiguration, ctx: Ctx) {
123122
targetDirectory: "build",
124123
stagingDirectory: cross ? "cross-staging" : "staging",
125124
cmakeToUse: await which("cmake"),
126-
generatorToUse: os === "win32" ? "Visual Studio 17 2022" : "Ninja",
127-
generatorBinary: os === "win32" ? undefined : await which("ninja"),
128-
generatorFlags: os === "win32" ? ["-A", getCMakeArchitecture(arch, os)] : undefined,
125+
generatorToUse: "Ninja",
126+
generatorBinary: await which("ninja"),
129127
CMakeOptions: [],
130128
addonSubdirectory: "",
131129
additionalDefines: [],

0 commit comments

Comments
 (0)