broke jvm
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import org.gradle.internal.jvm.Jvm
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "2.3.0"
|
||||
}
|
||||
@ -37,4 +39,35 @@ tasks.register<JavaExec>("runClient") {
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
mainClass.set("su.sonoma.MainKt")
|
||||
args = listOf("client")
|
||||
jvmArgs = listOf(
|
||||
"--add-opens=java.base/java.io=ALL-UNNAMED"
|
||||
)
|
||||
dependsOn("buildTunLib")
|
||||
}
|
||||
|
||||
val javaHome = Jvm.current().javaHome.absolutePath
|
||||
|
||||
tasks.register<Exec>("buildTunLib") {
|
||||
group = "build"
|
||||
|
||||
val outputDir = layout.buildDirectory.dir("native").get().asFile
|
||||
|
||||
doFirst {
|
||||
outputDir.mkdirs()
|
||||
}
|
||||
|
||||
commandLine(
|
||||
"gcc",
|
||||
"-shared",
|
||||
"-fPIC",
|
||||
"-z", "noexecstack",
|
||||
|
||||
"-o",
|
||||
"${outputDir.absolutePath}/libtun.so",
|
||||
|
||||
"src/main/c/tun.c",
|
||||
|
||||
"-I$javaHome/include",
|
||||
"-I$javaHome/include/linux"
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user