From 1d06f87d2d21add147a97a7c414f5eefe92fdb06 Mon Sep 17 00:00:00 2001 From: Anton Sakhon <58438890+Kofhein@users.noreply.github.com> Date: Mon, 20 Mar 2023 19:40:08 +0200 Subject: [PATCH] Use all cores during build (#171) * Use all cores during build * Updated Authors --------- Co-authored-by: Anton Sakhon --- AUTHORS | 1 + lib/elinux_build_target.dart | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index cf97253..f7a2e3a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,3 +9,4 @@ Michael Lamers (info@devmil.de) Andrea Daoud (andreadaoud6@gmail.com) Taha Firoz (mtahafiroz@gmail.com) Weiwei Duan (duanweiwei1982@gmail.com) +Anton Sakhon (kofhein@gmail.com) diff --git a/lib/elinux_build_target.dart b/lib/elinux_build_target.dart index cfa0be4..40dc062 100644 --- a/lib/elinux_build_target.dart +++ b/lib/elinux_build_target.dart @@ -394,8 +394,18 @@ class NativeBundle { throwToolExit('Failed to cmake:\n$result'); } + final procResult = await Process.run('nproc', []); + + final numProc = procResult.stdout.toString().trim(); + result = await _processUtils.run( - ['cmake', '--build', '.'], + [ + 'cmake', + '--build', + '.', + '--parallel', + numProc, + ], workingDirectory: outputDir.path, ); if (result.exitCode != 0) {