Skip to content

Commit d3839f1

Browse files
committed
Parallelize CMake builds
1 parent aed1325 commit d3839f1

File tree

1 file changed

+4
-2
lines changed
  • build-support/src/main/kotlin/aws/sdk/kotlin/gradle/crt

1 file changed

+4
-2
lines changed

build-support/src/main/kotlin/aws/sdk/kotlin/gradle/crt/CMakeTasks.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,16 @@ private fun Project.registerCmakeBuildTask(
151151
outputs.dir(cmakeBuildDir)
152152

153153
doLast {
154+
val coresPlusOne = (Runtime.getRuntime().availableProcessors().toInt() + 1).toString()
155+
154156
val args = mutableListOf(
155157
"--build",
156158
relativeBuildDir,
157159
"--config",
158160
buildType.toString(),
159161
// FIXME There is a parallelism issue between linuxx64 and linuxarm64 causing flaky builds
160-
// "--parallel",
161-
// System.getProperty("org.gradle.workers.max", "16"),
162+
"--parallel",
163+
System.getProperty("org.gradle.workers.max", coresPlusOne),
162164
)
163165

164166
val osxSdk = knTarget.konanTarget.osxDeviceSdkName

0 commit comments

Comments
 (0)