Native window decorations: avoid using C-runtime, which reduces the DLL size from 100kb to 8kb

This commit is contained in:
Karl Tauber
2021-03-06 12:01:49 +01:00
parent 144d65c776
commit 8734b062dc
7 changed files with 308 additions and 17 deletions

View File

@@ -55,7 +55,7 @@ library {
compilerArgs.addAll( toolChain.map {
when( it ) {
is Gcc, is Clang -> listOf( "-O2" )
is VisualCpp -> listOf( "/O2" )
is VisualCpp -> listOf( "/O2", "/Zl", "/GS-" )
else -> emptyList()
}
} )
@@ -70,8 +70,8 @@ library {
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" )
is VisualCpp -> listOf( "${jawt}.lib", "User32.lib", "shell32.lib", "AdvAPI32.lib" )
is Gcc, is Clang -> listOf( "-l${jawt}", "-lUser32", "-lshell32", "-lAdvAPI32", "-lKernel32" )
is VisualCpp -> listOf( "${jawt}.lib", "User32.lib", "shell32.lib", "AdvAPI32.lib", "Kernel32.lib", "/NODEFAULTLIB" )
else -> emptyList()
}
} )