Merge PR #707: Windows on ARM Support

This commit is contained in:
Karl Tauber
2023-08-05 16:14:00 +02:00
5 changed files with 16 additions and 10 deletions

View File

@@ -5,6 +5,8 @@ FlatLaf Change Log
#### New features and improvements
- FlatLaf window decorations: Support for Windows on ARM 64-bit. (issue #443, PR
#707)
- Extras: Class `FlatSVGIcon` now uses [JSVG](https://github.com/weisJ/jsvg)
library (instead of svgSalamander) for rendering. JSVG provides improved SVG
rendering and uses less memory compared to svgSalamander. (PR #684)

View File

@@ -129,6 +129,7 @@ flatlafPublish {
nativeArtifacts = listOf(
NativeArtifact( "${natives}/flatlaf-windows-x86.dll", "windows-x86", "dll" ),
NativeArtifact( "${natives}/flatlaf-windows-x86_64.dll", "windows-x86_64", "dll" ),
NativeArtifact( "${natives}/flatlaf-windows-arm64.dll", "windows-arm64", "dll" ),
NativeArtifact( "${natives}/libflatlaf-linux-x86_64.so", "linux-x86_64", "so" ),
)
}

View File

@@ -55,10 +55,16 @@ class FlatNativeLibrary
String classifier;
String ext;
if( SystemInfo.isWindows_10_orLater && (SystemInfo.isX86 || SystemInfo.isX86_64) ) {
// Windows: requires Windows 10/11 (x86 or x86_64)
if( SystemInfo.isWindows_10_orLater && (SystemInfo.isX86 || SystemInfo.isX86_64 || SystemInfo.isAARCH64) ) {
// Windows: requires Windows 10/11 (x86, x86_64 or aarch64)
if( SystemInfo.isAARCH64 )
classifier = "windows-arm64";
else if( SystemInfo.isX86_64 )
classifier = "windows-x86_64";
else
classifier = "windows-x86";
classifier = SystemInfo.isX86_64 ? "windows-x86_64" : "windows-x86";
ext = "dll";
// Do not load jawt.dll (part of JRE) here explicitly because

View File

@@ -88,10 +88,6 @@ class FlatWindowsNativeWindowBorder
if( !SystemInfo.isWindows_10_orLater )
return null;
// requires x86 architecture
if( !SystemInfo.isX86 && !SystemInfo.isX86_64 )
return null;
// check whether native library was successfully loaded
if( !FlatNativeLibrary.isLoaded() )
return null;

View File

@@ -29,7 +29,7 @@ flatlafJniHeaders {
}
library {
targetMachines.set( listOf( machines.windows.x86, machines.windows.x86_64 ) )
targetMachines.set( listOf( machines.windows.x86, machines.windows.x86_64, machines.windows.architecture( "aarch64" ) ) )
}
var javaHome = System.getProperty( "java.home" )
@@ -42,7 +42,7 @@ tasks {
description = "Builds natives"
if( org.gradle.internal.os.OperatingSystem.current().isWindows() )
dependsOn( "linkReleaseX86", "linkReleaseX86-64" )
dependsOn( "linkReleaseX86", "linkReleaseX86-64", "linkReleaseAarch64" )
}
withType<CppCompile>().configureEach {
@@ -69,8 +69,9 @@ tasks {
onlyIf { name.contains( "Release" ) }
val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" )
val isX86 = name.contains("X86")
val is64Bit = name.contains( "64" )
val libraryName = if( is64Bit ) "flatlaf-windows-x86_64.dll" else "flatlaf-windows-x86.dll"
val libraryName = if( is64Bit && isX86 ) "flatlaf-windows-x86_64.dll" else if( isX86 ) "flatlaf-windows-x86.dll" else "flatlaf-windows-arm64.dll"
linkerArgs.addAll( toolChain.map {
when( it ) {