diff --git a/examples/kotlin-multiplatform/build.gradle b/examples/kotlin-multiplatform/build.gradle index af6e7597..958bf2ba 100644 --- a/examples/kotlin-multiplatform/build.gradle +++ b/examples/kotlin-multiplatform/build.gradle @@ -30,6 +30,12 @@ kotlin { applyDefaultHierarchyTemplate() + targets.configureEach { + compilations.configureEach { + kotlinOptions.allWarningsAsErrors = true + } + } + sourceSets.configureEach { languageSettings { progressiveMode = true diff --git a/runtime/build.gradle b/runtime/build.gradle index 2f5892c5..32dd1f5d 100644 --- a/runtime/build.gradle +++ b/runtime/build.gradle @@ -45,7 +45,10 @@ kotlin { targets.configureEach { compilations.configureEach { - kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes" + compilerOptions.options.with { + allWarningsAsErrors.set(true) + freeCompilerArgs.add("-Xexpect-actual-classes") + } } } @@ -54,8 +57,6 @@ kotlin { resources.srcDirs = ["$it.name/resources"] languageSettings { progressiveMode = true - optIn('kotlin.experimental.ExperimentalNativeApi') - optIn("kotlinx.cinterop.ExperimentalForeignApi") } } @@ -108,3 +109,11 @@ if (project.findProperty("publication_repository") == "space") { tasks.withType(KotlinNativeCompile).matching { it.name.toLowerCase().contains("test") }.configureEach { it.dependsOn(tasks.withType(Sign)) } + +tasks.withType(KotlinNativeCompile).configureEach { + compilerOptions.freeCompilerArgs.addAll( + "-opt-in=kotlin.experimental.ExperimentalNativeApi", + "-opt-in=kotlin.native.runtime.NativeRuntimeApi", + "-opt-in=kotlinx.cinterop.ExperimentalForeignApi", + ) +} diff --git a/runtime/nativeMain/src/kotlinx/benchmark/native/NativeExecutor.kt b/runtime/nativeMain/src/kotlinx/benchmark/native/NativeExecutor.kt index 55ba6f8d..dff5de0b 100644 --- a/runtime/nativeMain/src/kotlinx/benchmark/native/NativeExecutor.kt +++ b/runtime/nativeMain/src/kotlinx/benchmark/native/NativeExecutor.kt @@ -1,7 +1,7 @@ package kotlinx.benchmark.native import kotlinx.benchmark.* -import kotlin.native.internal.GC +import kotlin.native.runtime.GC import kotlin.time.* class NativeExecutor( @@ -218,7 +218,6 @@ class NativeExecutor( return getStackTrace().joinToString("\n") + "\nCause: ${nested.message}\n" + nested.stacktrace() } - @OptIn(ExperimentalTime::class) private inline fun measure( cycles: Int, nativeGCAfterIteration: Boolean, @@ -239,7 +238,6 @@ class NativeExecutor( return duration.toDouble(DurationUnit.NANOSECONDS) / cycles } - @OptIn(ExperimentalTime::class) private inline fun measureWarmup( name: String, config: BenchmarkConfiguration,