@@ -42,6 +42,11 @@ const DEFAULT_NDK_VERSION = "27.1.12297006";
42
42
43
43
// TODO: Add automatic ccache support
44
44
45
+ const verboseOption = new Option (
46
+ "--verbose" ,
47
+ "Print more output during the build"
48
+ ) . default ( process . env . CI === "true" ) ;
49
+
45
50
const sourcePathOption = new Option (
46
51
"--source <path>" ,
47
52
"Specify the source directory containing a CMakeLists.txt file"
@@ -163,6 +168,7 @@ export const program = new Command("cmake-rn")
163
168
// Configure every triplet project
164
169
await oraPromise ( Promise . all ( tripletContext . map ( configureProject ) ) , {
165
170
text : "Configuring projects" ,
171
+ isSilent : globalContext . verbose ,
166
172
successText : "Configured projects" ,
167
173
failText : ( { message } ) => `Failed to configure projects: ${ message } ` ,
168
174
} ) ;
@@ -182,6 +188,7 @@ export const program = new Command("cmake-rn")
182
188
) ,
183
189
{
184
190
text : "Building projects" ,
191
+ isSilent : globalContext . verbose ,
185
192
successText : "Built projects" ,
186
193
failText : ( { message } ) => `Failed to build projects: ${ message } ` ,
187
194
}
@@ -365,8 +372,14 @@ function getBuildArgs(triplet: SupportedTriplet) {
365
372
}
366
373
367
374
async function configureProject ( context : TripletScopedContext ) {
368
- const { triplet, tripletBuildPath, source, ndkVersion, weakNodeApiLinkage } =
369
- context ;
375
+ const {
376
+ verbose,
377
+ triplet,
378
+ tripletBuildPath,
379
+ source,
380
+ ndkVersion,
381
+ weakNodeApiLinkage,
382
+ } = context ;
370
383
await spawn (
371
384
"cmake" ,
372
385
[
@@ -381,13 +394,14 @@ async function configureProject(context: TripletScopedContext) {
381
394
} ) ,
382
395
] ,
383
396
{
384
- outputMode : "buffered" ,
397
+ outputMode : verbose ? "inherit" : "buffered" ,
398
+ outputPrefix : verbose ? chalk . dim ( `[${ triplet } ] ` ) : undefined ,
385
399
}
386
400
) ;
387
401
}
388
402
389
403
async function buildProject ( context : TripletScopedContext ) {
390
- const { triplet, tripletBuildPath, configuration } = context ;
404
+ const { verbose , triplet, tripletBuildPath, configuration } = context ;
391
405
await spawn (
392
406
"cmake" ,
393
407
[
@@ -399,7 +413,8 @@ async function buildProject(context: TripletScopedContext) {
399
413
...getBuildArgs ( triplet ) ,
400
414
] ,
401
415
{
402
- outputMode : "buffered" ,
416
+ outputMode : verbose ? "inherit" : "buffered" ,
417
+ outputPrefix : verbose ? chalk . dim ( `[${ triplet } ] ` ) : undefined ,
403
418
}
404
419
) ;
405
420
}
0 commit comments