Skip to content

Commit b31d2e4

Browse files
committed
migrate to compiler options api and enable experimentalforeignapi on native tasks
1 parent 92fb46c commit b31d2e4

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

libs/sse2/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.gradle.kotlin.dsl.withType
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
3+
14
plugins {
25
alias(libs.plugins.conventions.kmp)
36
alias(libs.plugins.conventions.linting)
@@ -17,13 +20,6 @@ kotlin {
1720
}
1821

1922
sourceSets {
20-
21-
all {
22-
languageSettings {
23-
optIn("kotlinx.cinterop.ExperimentalForeignApi")
24-
}
25-
}
26-
2723
commonMain {
2824
dependencies {}
2925
}
@@ -36,6 +32,12 @@ kotlin {
3632
}
3733
}
3834

35+
tasks.withType<KotlinNativeCompile>().configureEach {
36+
compilerOptions {
37+
optIn.add("kotlinx.cinterop.ExperimentalForeignApi")
38+
}
39+
}
40+
3941
configure<PublishingConventionsExtension> {
4042
name = "numeric"
4143
description = "numeric operations for chasms runtime execution"

memory/build.gradle.kts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
3+
14
plugins {
25
alias(libs.plugins.conventions.kmp)
36
alias(libs.plugins.conventions.linting)
@@ -15,15 +18,7 @@ bolt {
1518
}
1619

1720
kotlin {
18-
1921
sourceSets {
20-
21-
all {
22-
languageSettings {
23-
optIn("kotlinx.cinterop.ExperimentalForeignApi")
24-
}
25-
}
26-
2722
commonMain {
2823
dependencies {
2924
api(projects.runtime.core)
@@ -39,6 +34,12 @@ kotlin {
3934
}
4035
}
4136

37+
tasks.withType<KotlinNativeCompile>().configureEach {
38+
compilerOptions {
39+
optIn.add("kotlinx.cinterop.ExperimentalForeignApi")
40+
}
41+
}
42+
4243
configure<PublishingConventionsExtension> {
4344
name = "memory"
4445
description = "a kotlin multiplatform wasm linear memory implementation"

0 commit comments

Comments
 (0)