Skip to content

Commit

Permalink
Apply binaryen only for production builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rjaros committed Nov 8, 2023
1 parent 5446aff commit 175ab6f
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 63 deletions.
34 changes: 18 additions & 16 deletions examples/bootstrap-form/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,24 @@ kotlin {
}
}
binaries.executable()
applyBinaryen {
binaryenArgs = mutableListOf(
"--enable-nontrapping-float-to-int",
"--enable-gc",
"--enable-reference-types",
"--enable-exception-handling",
"--enable-bulk-memory",
"--inline-functions-with-loops",
"--traps-never-happen",
"--fast-math",
"--closed-world",
"--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
)
if (project.gradle.startParameter.taskNames.contains("wasmJsBrowserProductionWebpack")) {
applyBinaryen {
binaryenArgs = mutableListOf(
"--enable-nontrapping-float-to-int",
"--enable-gc",
"--enable-reference-types",
"--enable-exception-handling",
"--enable-bulk-memory",
"--inline-functions-with-loops",
"--traps-never-happen",
"--fast-math",
"--closed-world",
"--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
)
}
}
}
}
Expand Down
34 changes: 18 additions & 16 deletions examples/hello-world/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,24 @@ kotlin {
}
}
binaries.executable()
applyBinaryen {
binaryenArgs = mutableListOf(
"--enable-nontrapping-float-to-int",
"--enable-gc",
"--enable-reference-types",
"--enable-exception-handling",
"--enable-bulk-memory",
"--inline-functions-with-loops",
"--traps-never-happen",
"--fast-math",
"--closed-world",
"--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
)
if (project.gradle.startParameter.taskNames.contains("wasmJsBrowserProductionWebpack")) {
applyBinaryen {
binaryenArgs = mutableListOf(
"--enable-nontrapping-float-to-int",
"--enable-gc",
"--enable-reference-types",
"--enable-exception-handling",
"--enable-bulk-memory",
"--inline-functions-with-loops",
"--traps-never-happen",
"--fast-math",
"--closed-world",
"--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
)
}
}
}
}
Expand Down
32 changes: 17 additions & 15 deletions examples/js-framework-benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,23 @@ kotlin {
}
binaries.executable()
applyBinaryen {
binaryenArgs = mutableListOf(
"--enable-nontrapping-float-to-int",
"--enable-gc",
"--enable-reference-types",
"--enable-exception-handling",
"--enable-bulk-memory",
"--inline-functions-with-loops",
"--traps-never-happen",
"--fast-math",
"--closed-world",
"--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
)
if (project.gradle.startParameter.taskNames.contains("wasmJsBrowserProductionWebpack")) {
binaryenArgs = mutableListOf(
"--enable-nontrapping-float-to-int",
"--enable-gc",
"--enable-reference-types",
"--enable-exception-handling",
"--enable-bulk-memory",
"--inline-functions-with-loops",
"--traps-never-happen",
"--fast-math",
"--closed-world",
"--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
)
}
}
}
}
Expand Down
34 changes: 18 additions & 16 deletions examples/playground/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,24 @@ kotlin {
}
}
binaries.executable()
applyBinaryen {
binaryenArgs = mutableListOf(
"--enable-nontrapping-float-to-int",
"--enable-gc",
"--enable-reference-types",
"--enable-exception-handling",
"--enable-bulk-memory",
"--inline-functions-with-loops",
"--traps-never-happen",
"--fast-math",
"--closed-world",
"--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
)
if (project.gradle.startParameter.taskNames.contains("wasmJsBrowserProductionWebpack")) {
applyBinaryen {
binaryenArgs = mutableListOf(
"--enable-nontrapping-float-to-int",
"--enable-gc",
"--enable-reference-types",
"--enable-exception-handling",
"--enable-bulk-memory",
"--inline-functions-with-loops",
"--traps-never-happen",
"--fast-math",
"--closed-world",
"--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
"-O3", "--gufa", "--metrics",
)
}
}
}
}
Expand Down

0 comments on commit 175ab6f

Please sign in to comment.