Disable -XstartOnFirstThread when not on Mac. (#5782)

* Disable `-XstartOnFirstThread` when not on Mac.

* Update desktop Mac arguments.

* Disable JVM Mac args only for `desktop:run`.
This commit is contained in:
will-ca 2021-12-22 09:17:50 -08:00 committed by GitHub
parent f4f673dc8a
commit 90df253783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,10 @@ val deployFolder = file("../deploy")
// and https://github.com/yairm210/Unciv/issues/5679
val jvmArgsForMac = listOf("-XstartOnFirstThread", "-Djava.awt.headless=true")
tasks.register<JavaExec>("run") {
jvmArgs = jvmArgsForMac
jvmArgs = mutableListOf<String>()
if ("mac" in System.getProperty("os.name").toLowerCase())
(jvmArgs as MutableList<String>).addAll(jvmArgsForMac)
// These are non-standard, only available/necessary on Mac.
dependsOn(tasks.getByName("classes"))
@ -159,4 +162,4 @@ tasks.register<Zip>("zipLinuxFilesForJar") {
archiveFileName.set("linuxFilesForJar.zip")
from(file("linuxFilesForJar"))
destinationDirectory.set(deployFolder)
}
}