@@ -23,6 +23,7 @@ async function parseArguments() {
23
23
const options = {
24
24
gitURL : { short : 'u' , type : 'string' , default : 'https://github.com/mongodb/libmongocrypt.git' } ,
25
25
libVersion : { short : 'l' , type : 'string' , default : pkg [ 'mongodb:libmongocrypt' ] } ,
26
+ 'cmake-path' : { type : 'string' , default : 'cmake' } ,
26
27
'no-macos-universal' : { type : 'boolean' , default : false } ,
27
28
clean : { short : 'c' , type : 'boolean' , default : false } ,
28
29
build : { short : 'b' , type : 'boolean' , default : false } ,
@@ -51,6 +52,7 @@ async function parseArguments() {
51
52
build : args . values . build ,
52
53
dynamic : args . values . dynamic ,
53
54
noMacosUniversal : args . values [ 'no-macos-universal' ] ,
55
+ cMakePath : args . values [ 'cmake-path' ] ,
54
56
pkg
55
57
} ;
56
58
}
@@ -86,7 +88,7 @@ export async function cloneLibMongoCrypt(libmongocryptRoot, { url, ref }) {
86
88
}
87
89
}
88
90
89
- export async function buildLibMongoCrypt ( libmongocryptRoot , nodeDepsRoot ) {
91
+ export async function buildLibMongoCrypt ( libmongocryptRoot , nodeDepsRoot , options ) {
90
92
console . error ( 'building libmongocrypt...' ) ;
91
93
92
94
const nodeBuildRoot = resolveRoot ( nodeDepsRoot , 'tmp' , 'libmongocrypt-build' ) ;
@@ -136,11 +138,11 @@ export async function buildLibMongoCrypt(libmongocryptRoot, nodeDepsRoot) {
136
138
: [ ] ;
137
139
138
140
await run (
139
- 'cmake' ,
141
+ options . cMakePath ,
140
142
[ ...CMAKE_FLAGS , ...WINDOWS_CMAKE_FLAGS , ...DARWIN_CMAKE_FLAGS , libmongocryptRoot ] ,
141
143
{ cwd : nodeBuildRoot }
142
144
) ;
143
- await run ( 'cmake' , [ '--build' , '.' , '--target' , 'install' , '--config' , 'RelWithDebInfo' ] , {
145
+ await run ( options . cMakePath , [ '--build' , '.' , '--target' , 'install' , '--config' , 'RelWithDebInfo' ] , {
144
146
cwd : nodeBuildRoot
145
147
} ) ;
146
148
}
@@ -257,7 +259,7 @@ async function main() {
257
259
const isBuilt = libmongocryptBuiltVersion . trim ( ) === args . ref ;
258
260
259
261
if ( args . clean || ! isBuilt ) {
260
- await buildLibMongoCrypt ( libmongocryptCloneDir , nodeDepsDir ) ;
262
+ await buildLibMongoCrypt ( libmongocryptCloneDir , nodeDepsDir , args ) ;
261
263
}
262
264
} else if ( ! args . dynamic ) {
263
265
// Download
0 commit comments