Skip to content

Commit 071fdc6

Browse files
committed
chore: add cmake-path
1 parent 0f020b6 commit 071fdc6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/scripts/libmongocrypt.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ async function parseArguments() {
2323
const options = {
2424
gitURL: { short: 'u', type: 'string', default: 'https://github.com/mongodb/libmongocrypt.git' },
2525
libVersion: { short: 'l', type: 'string', default: pkg['mongodb:libmongocrypt'] },
26+
'cmake-path': { type: 'string', default: 'cmake' },
2627
'no-macos-universal': { type: 'boolean', default: false },
2728
clean: { short: 'c', type: 'boolean', default: false },
2829
build: { short: 'b', type: 'boolean', default: false },
@@ -51,6 +52,7 @@ async function parseArguments() {
5152
build: args.values.build,
5253
dynamic: args.values.dynamic,
5354
noMacosUniversal: args.values['no-macos-universal'],
55+
cMakePath: args.values['cmake-path'],
5456
pkg
5557
};
5658
}
@@ -86,7 +88,7 @@ export async function cloneLibMongoCrypt(libmongocryptRoot, { url, ref }) {
8688
}
8789
}
8890

89-
export async function buildLibMongoCrypt(libmongocryptRoot, nodeDepsRoot) {
91+
export async function buildLibMongoCrypt(libmongocryptRoot, nodeDepsRoot, options) {
9092
console.error('building libmongocrypt...');
9193

9294
const nodeBuildRoot = resolveRoot(nodeDepsRoot, 'tmp', 'libmongocrypt-build');
@@ -136,11 +138,11 @@ export async function buildLibMongoCrypt(libmongocryptRoot, nodeDepsRoot) {
136138
: [];
137139

138140
await run(
139-
'cmake',
141+
options.cMakePath,
140142
[...CMAKE_FLAGS, ...WINDOWS_CMAKE_FLAGS, ...DARWIN_CMAKE_FLAGS, libmongocryptRoot],
141143
{ cwd: nodeBuildRoot }
142144
);
143-
await run('cmake', ['--build', '.', '--target', 'install', '--config', 'RelWithDebInfo'], {
145+
await run(options.cMakePath, ['--build', '.', '--target', 'install', '--config', 'RelWithDebInfo'], {
144146
cwd: nodeBuildRoot
145147
});
146148
}
@@ -257,7 +259,7 @@ async function main() {
257259
const isBuilt = libmongocryptBuiltVersion.trim() === args.ref;
258260

259261
if (args.clean || !isBuilt) {
260-
await buildLibMongoCrypt(libmongocryptCloneDir, nodeDepsDir);
262+
await buildLibMongoCrypt(libmongocryptCloneDir, nodeDepsDir, args);
261263
}
262264
} else if (!args.dynamic) {
263265
// Download

0 commit comments

Comments
 (0)