Only build static executable if musl toolchain is installed (#83)

This improves the development experience for (WSL) Linux users.
They can now run "./gradlew buildNative" without having a musl toolchain installed.
In this case, only the dynamically linked executable will be built.
This commit is contained in:
translatenix
2024-02-07 20:57:53 -08:00
committed by GitHub
parent a6e59c07ff
commit 77d0f5b8ca
3 changed files with 7 additions and 2 deletions

View File

@@ -254,7 +254,7 @@ val linuxExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class)
*/
val alpineExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
configureExecutable(
buildInfo.os.isLinux && buildInfo.arch == "amd64",
buildInfo.os.isLinux && buildInfo.arch == "amd64" && buildInfo.hasMuslToolchain,
file("$buildDir/executable/pkl-alpine-linux-amd64"),
listOf(
"--static",