Skip to content

Commit

Permalink
Only set -Xjvm-default=all-compatibility on JVM targets
Browse files Browse the repository at this point in the history
  • Loading branch information
joffrey-bion committed Oct 6, 2024
1 parent 45146c1 commit c0ad71b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion gradle/plugins/src/main/kotlin/Targets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ fun KotlinMultiplatformExtension.allTargets() {
}
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
fun KotlinMultiplatformExtension.ktorTargets() {
jvm()
jvm {
compilerOptions {
freeCompilerArgs.add("-Xjvm-default=all-compatibility")
}
}
js {
browser()
nodejs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ kotlin {
}
compilerOptions {
progressiveMode = true
// we can't enable this yet because of -Xjvm-default=all-compatibility generating a waning on non-JVM

// We can't enable 'allWarningsAsErrors' yet because of the unique_name warning:
// KLIB resolver: The same 'unique_name=org.hildan.krossbow:krossbow-websocket-core' found in more than one library:
// <root>\krossbow-websocket-core\build\classes\kotlin\wasmJs\main,
// <root>\krossbow-websocket-core\build\libs\krossbow-websocket-core-wasm-js.klib
// allWarningsAsErrors = true
freeCompilerArgs.add("-Xjvm-default=all-compatibility")

// Note: target-specific compiler options are set in the target helpers (see Targets.kt)
}
}

0 comments on commit c0ad71b

Please sign in to comment.