Unverified Commit ae47b1d7 authored by Nikolay Igotti's avatar Nikolay Igotti Committed by GitHub

Move to Kotlin 1.5.10, improve cross-compilation. (#130)

parent 913a31a1
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.72"
kotlin("jvm") version "1.5.10"
application
}
......
......@@ -18,7 +18,7 @@ import java.io.File
import java.nio.file.Files
import javax.imageio.ImageIO
fun main(args: Array<String>) {
fun main() {
val windows = 1
repeat(windows) {
createWindow("window $it", windows == 1)
......
......@@ -6,7 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.CInteropProcess
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
plugins {
kotlin("multiplatform") version "1.4.30"
kotlin("multiplatform") version "1.5.10"
`cpp-library`
`maven-publish`
id("org.gradle.crypto.checksum") version "1.1.0"
......@@ -286,6 +286,7 @@ tasks.withType(CppCompile::class.java).configureEach {
"-DSK_SHAPER_CORETEXT_AVAILABLE",
"-DSK_BUILD_FOR_MAC",
"-DSK_METAL",
*targetArch.clangFlags,
*buildType.clangFlags
)
)
......@@ -342,6 +343,7 @@ project.tasks.register<Exec>("objcCompile") {
val skiaDir = skiaDir.get().absolutePath
commandLine = listOf(
"clang",
*targetArch.clangFlags,
"-mmacosx-version-min=10.13",
"-I$jdkHome/include",
"-I$jdkHome/include/darwin",
......@@ -428,6 +430,7 @@ tasks.withType(LinkSharedLibrary::class.java).configureEach {
dependsOn(project.tasks.named("objcCompile"))
linkerArgs.addAll(
listOf(
*targetArch.clangFlags,
"-dead_strip",
"-framework", "AppKit",
"-framework", "CoreFoundation",
......
......@@ -11,9 +11,9 @@ enum class OS(val id: String) {
get() = this == Windows
}
enum class Arch(val id: String) {
X64("x64"),
Arm64("arm64"),
enum class Arch(val id: String, val clangFlags: Array<String>) {
X64("x64", arrayOf("-arch", "x86_64")),
Arm64("arm64", arrayOf("-arch", "arm64"))
}
enum class SkiaBuildType(
......
......@@ -39,7 +39,7 @@ val hostId by lazy {
}
internal val hostFullName by lazy {
"${System.getProperty("os.name")}, ${System.getProperty("os.version")}, ${hostArch.toString().toLowerCase()}"
"${System.getProperty("os.name")}, ${System.getProperty("os.version")}, ${hostArch.id}"
}
internal val javaVendor by lazy {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment