mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
Linux: support building native library for ARM64 when Gradle build runs on ARM64 Linux (issue #899)
This commit is contained in:
@@ -28,11 +28,14 @@ flatlafJniHeaders {
|
|||||||
}
|
}
|
||||||
|
|
||||||
library {
|
library {
|
||||||
targetMachines = listOf( machines.linux.x86_64 )
|
targetMachines = listOf(
|
||||||
|
machines.linux.x86_64,
|
||||||
|
machines.linux.architecture( "aarch64" ),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
var javaHome = System.getProperty( "java.home" )
|
var javaHome = System.getProperty( "java.home" )
|
||||||
if( javaHome.endsWith( "jre" ) )
|
if( javaHome.endsWith( "jre" ) && !file( "${javaHome}/include" ).exists() )
|
||||||
javaHome += "/.."
|
javaHome += "/.."
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@@ -40,8 +43,13 @@ tasks {
|
|||||||
group = "build"
|
group = "build"
|
||||||
description = "Builds natives"
|
description = "Builds natives"
|
||||||
|
|
||||||
if( org.gradle.internal.os.OperatingSystem.current().isLinux )
|
if( org.gradle.internal.os.OperatingSystem.current().isLinux ) {
|
||||||
dependsOn( "linkRelease" )
|
val osArch = System.getProperty( "os.arch" )
|
||||||
|
if( osArch == "amd64" || osArch == "x86-64" )
|
||||||
|
dependsOn( "linkReleaseX86-64" )
|
||||||
|
if( osArch == "aarch64" )
|
||||||
|
dependsOn( "linkReleaseAarch64" )
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
withType<CppCompile>().configureEach {
|
withType<CppCompile>().configureEach {
|
||||||
@@ -67,7 +75,7 @@ tasks {
|
|||||||
onlyIf { name.contains( "Release" ) }
|
onlyIf { name.contains( "Release" ) }
|
||||||
|
|
||||||
val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" )
|
val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" )
|
||||||
val libraryName = "libflatlaf-linux-x86_64.so"
|
val libraryName = if( name.contains( "X86-64" ) ) "libflatlaf-linux-x86_64.so" else "libflatlaf-linux-arm64.so"
|
||||||
val jawt = "jawt"
|
val jawt = "jawt"
|
||||||
var jawtPath = "${javaHome}/lib"
|
var jawtPath = "${javaHome}/lib"
|
||||||
if( JavaVersion.current() == JavaVersion.VERSION_1_8 )
|
if( JavaVersion.current() == JavaVersion.VERSION_1_8 )
|
||||||
|
|||||||
Reference in New Issue
Block a user