mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-09 08:15:09 +03:00
Native window decorations: support 32-bit JREs
This commit is contained in:
@@ -9,9 +9,9 @@ Tested only with Microsoft Visual C++ 2019 (comes with Visual Studio 2019).
|
||||
|
||||
To be able to build FlatLaf on any platform, and without C++ compiler, the
|
||||
pre-built DLL is checked into Git at
|
||||
`flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/flatlaf-windows-x86_64.dll`.
|
||||
[flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/](https://github.com/JFormDesigner/FlatLaf/tree/main/flatlaf-core/src/main/resources/com/formdev/flatlaf/natives).
|
||||
|
||||
This DLL was built on a GitHub server with the help of GitHub Actions. See:
|
||||
The DLL was built on a GitHub server with the help of GitHub Actions. See:
|
||||
[Native Libraries](https://github.com/JFormDesigner/FlatLaf/actions/workflows/natives.yml)
|
||||
workflow. Then the produced Artifacts ZIP was downloaded and the DLL checked
|
||||
into Git.
|
||||
|
||||
@@ -20,18 +20,16 @@ plugins {
|
||||
}
|
||||
|
||||
library {
|
||||
targetMachines.set( listOf( machines.windows.x86_64 ) )
|
||||
targetMachines.set( listOf( machines.windows.x86, machines.windows.x86_64 ) )
|
||||
|
||||
variants.configureEach {
|
||||
// depend on :flatlaf-core:compileJava because this task generates the JNI headers
|
||||
tasks.named( "compileCpp" ) {
|
||||
dependsOn( ":flatlaf-core:compileJava" )
|
||||
}
|
||||
|
||||
sharedLibrary {
|
||||
compileTasks.configureEach {
|
||||
onlyIf { isBuildable }
|
||||
|
||||
// depend on :flatlaf-core:compileJava because it generates the JNI headers
|
||||
dependsOn( ":flatlaf-core:compileJava" )
|
||||
|
||||
doFirst {
|
||||
println( "Used Tool Chain:" )
|
||||
println( " - ${toolChain.get()}" )
|
||||
@@ -67,11 +65,12 @@ library {
|
||||
onlyIf { isBuildable }
|
||||
|
||||
val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" )
|
||||
val libraryName = "flatlaf-windows-x86_64.dll"
|
||||
val is64Bit = targetMachine.architecture.is64Bit
|
||||
val libraryName = if( is64Bit ) "flatlaf-windows-x86_64.dll" else "flatlaf-windows-x86.dll"
|
||||
val jawt = if( is64Bit ) "lib/jawt-x86_64" else "lib/jawt-x86"
|
||||
|
||||
outputs.file( "$nativesDir/$libraryName" )
|
||||
|
||||
val jawt = "${org.gradle.internal.jvm.Jvm.current().javaHome}/lib/jawt"
|
||||
linkerArgs.addAll( toolChain.map {
|
||||
when( it ) {
|
||||
is Gcc, is Clang -> listOf( "-l${jawt}", "-lUser32", "-lshell32", "-lAdvAPI32", "-lKernel32" )
|
||||
@@ -90,8 +89,10 @@ library {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named( "jar" ) {
|
||||
onlyIf { false }
|
||||
for( taskName in listOf( "jarX86", "jarX86-64" ) ) {
|
||||
tasks.named( taskName ) {
|
||||
onlyIf { false }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
flatlaf-natives/flatlaf-natives-windows/lib/README.md
Normal file
6
flatlaf-natives/flatlaf-natives-windows/lib/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
Contains libraries used to compile FlatLaf Windows 10 native libraries (DLLs).
|
||||
|
||||
- `jawt-x86.lib` is `<jdk>/lib/jawt.lib` from AdoptOpenJDK jdk8u282-b08 32-bit,
|
||||
which is required to build 32-bit DLL
|
||||
- `jawt-x86_64.lib` is `<jdk>/lib/jawt.lib` from AdoptOpenJDK jdk8u282-b08
|
||||
64-bit, which is required to build 64-bit DLL
|
||||
BIN
flatlaf-natives/flatlaf-natives-windows/lib/jawt-x86.lib
Normal file
BIN
flatlaf-natives/flatlaf-natives-windows/lib/jawt-x86.lib
Normal file
Binary file not shown.
BIN
flatlaf-natives/flatlaf-natives-windows/lib/jawt-x86_64.lib
Normal file
BIN
flatlaf-natives/flatlaf-natives-windows/lib/jawt-x86_64.lib
Normal file
Binary file not shown.
Reference in New Issue
Block a user