From a566c663ec012869116186b219a67215af9cf079 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 21 Apr 2026 14:39:41 -0400 Subject: [PATCH] Better way to control the optimization level --- quartz/build.gradle.kts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/quartz/build.gradle.kts b/quartz/build.gradle.kts index d4ebb17ae1..cddf5558dc 100644 --- a/quartz/build.gradle.kts +++ b/quartz/build.gradle.kts @@ -94,12 +94,13 @@ kotlin { } // Enable LLVM optimizations for native test binaries (benchmark accuracy). - // Without -opt, K/N test binaries compile in debug mode (~20× slower). + // Without opt, K/N test binaries compile in debug mode (~20× slower). + // Use the binary-level API instead of -opt freeCompilerArg to avoid the + // "Unsupported combination of flags: -opt and -g" conflict in Kotlin/Native 2.1+. targets.withType().configureEach { - compilations["test"].compileTaskProvider.configure { - compilerOptions { - freeCompilerArgs.add("-opt") - } + binaries.withType().configureEach { + optimized = true + debuggable = false } }