Skip to content

Commit 6fbee4b

Browse files
authored
Temporarily disable native benchmarks' targets (#197)
Fixes #195
1 parent d995e33 commit 6fbee4b

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

benchmarks/build.gradle.kts

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ kotlin {
1919
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
2020
}
2121
}
22-
// TODO: consider supporting non-host native targets.
23-
if (HostManager.host === KonanTarget.MACOS_X64) macosX64("native")
24-
if (HostManager.host === KonanTarget.MACOS_ARM64) macosArm64("native")
25-
if (HostManager.hostIsLinux) linuxX64("native")
26-
if (HostManager.hostIsMingw) mingwX64("native")
2722

2823
sourceSets {
2924
commonMain {
@@ -36,9 +31,23 @@ kotlin {
3631
named("jvmMain") {
3732
dependsOn(commonMain.get())
3833
}
34+
}
35+
}
3936

40-
named("nativeMain") {
41-
dependsOn(commonMain.get())
37+
val nativeBenchmarksEnabled: String by project.parent!!
38+
39+
if (nativeBenchmarksEnabled.toBoolean()) {
40+
kotlin {
41+
// TODO: consider supporting non-host native targets.
42+
if (HostManager.host === KonanTarget.MACOS_X64) macosX64("native")
43+
if (HostManager.host === KonanTarget.MACOS_ARM64) macosArm64("native")
44+
if (HostManager.hostIsLinux) linuxX64("native")
45+
if (HostManager.hostIsMingw) mingwX64("native")
46+
47+
sourceSets {
48+
named("nativeMain") {
49+
dependsOn(commonMain.get())
50+
}
4251
}
4352
}
4453
}
@@ -49,6 +58,8 @@ benchmark {
4958
this as JvmBenchmarkTarget
5059
jmhVersion = libs.versions.jmh.get()
5160
}
52-
register("native")
61+
if (nativeBenchmarksEnabled.toBoolean()) {
62+
register("native")
63+
}
5364
}
5465
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
group=org.jetbrains.kotlinx
77
version=0.2.1-SNAPSHOT
8-
kotlin.version=1.8.21
98
kotlin.code.style=official
109
org.gradle.jvmargs=-Xmx4G
10+
nativeBenchmarksEnabled=false

0 commit comments

Comments
 (0)