@@ -34,7 +34,7 @@ WIN.compileSWT = true;
34
34
WIN . includeNull3d = true
35
35
36
36
// Lambda for naming the generated libs
37
- WIN . library = { name -> return " ${ name} .dll" as String }
37
+ WIN . library = { name -> return ( IS_STATIC_BUILD ? " ${ name} .lib " : " ${ name } . dll" ) as String }
38
38
39
39
WIN . libDest = " bin"
40
40
WIN . modLibDest = " lib"
@@ -116,8 +116,12 @@ def ccFlags = ["/nologo", "/W3", "/EHsc", "/c",
116
116
" /DUNICODE" , " /D_UNICODE" , " /DWIN32" , " /DIAL" , " /D_LITTLE_ENDIAN" , " /DWIN32_LEAN_AND_MEAN" ,
117
117
" /I$JDK_HOME /include" , " /I$JDK_HOME /include/win32" ,
118
118
ccDebugFlags]. flatten();
119
+ if (IS_STATIC_BUILD ) ccFlags. add(" /DSTATIC_BUILD" )
119
120
120
- def linkFlags = [" /nologo" , " /dll" , " /manifest" , " /opt:REF" , " /incremental:no" , " /dynamicbase" , " /nxcompat" ];
121
+ def linkFlags = [" /nologo" ]
122
+ if (! IS_STATIC_BUILD ) {
123
+ linkFlags + = [" /dll" , " /manifest" , " /opt:REF" , " /incremental:no" , " /dynamicbase" , " /nxcompat" ]
124
+ }
121
125
if (! IS_64 ) linkFlags. add(" /safeseh" );
122
126
if (IS_DEBUG_NATIVE ) linkFlags. add(" /debug" );
123
127
@@ -150,7 +154,7 @@ if (hasProperty('toolchainDir')) {
150
154
: " $WINDOWS_VS_VSINSTALLDIR /VC/BIN" )
151
155
}
152
156
def compiler = IS_COMPILE_PARFAIT ? " cl.exe" : cygpath(" $msvcBinDir /cl.exe" )
153
- def linker = IS_COMPILE_PARFAIT ? " link.exe" : cygpath(" $msvcBinDir /link.exe" )
157
+ def linker = IS_STATIC_BUILD ? ( IS_COMPILE_PARFAIT ? " lib.exe " : cygpath( " $m svcBinDir /lib.exe " )) : ( IS_COMPILE_PARFAIT ? " link.exe" : cygpath(" $msvcBinDir /link.exe" ) )
154
158
def winSdkBinDir = " $WINDOWS_SDK_DIR /Bin"
155
159
if (WINDOWS_VS_VER != " 100" ) {
156
160
winSdkBinDir + = " /$CPU_BITS "
@@ -219,6 +223,7 @@ def WinSDKDLLsPath = cygpath("${winSdkDllDir}")
219
223
if (file(WinSDKDLLsPath ). exists()) {
220
224
ext.WIN.WinSDKDLLNames = [
221
225
" api-ms-win-core-console-l1-1-0.dll" ,
226
+ " api-ms-win-core-console-l1-2-0.dll" ,
222
227
" api-ms-win-core-datetime-l1-1-0.dll" ,
223
228
" api-ms-win-core-debug-l1-1-0.dll" ,
224
229
" api-ms-win-core-errorhandling-l1-1-0.dll" ,
@@ -290,7 +295,7 @@ def rcFlags = [
290
295
" /d" , " \" JFX_BUILD_ID=${ rcVerBuild} \" " ,
291
296
" /d" , " \" JFX_COPYRIGHT=Copyright \u 00A9 ${ rcVerCopyrYear} \" " ,
292
297
" /d" , " \" JFX_FVER=${ rcVerFile} \" " ,
293
- " /d" , " \" JFX_FTYPE=0x2L\" " ,
298
+ " /d" , " \" JFX_FTYPE=${ IS_STATIC_BUILD ? "0x7L" : " 0x2L" } \" " ,
294
299
" /nologo"
295
300
];
296
301
@@ -313,10 +318,10 @@ WIN.glass.rcFlags = [
313
318
WIN . glass. ccFlags = [ccFlags, " /WX" ]. flatten()
314
319
if (WINDOWS_VS_VER != " 100" ) WIN . glass. ccFlags - = [" /WX" ]
315
320
WIN . glass. linker = linker
316
- WIN . glass. linkFlags = [linkFlags, " delayimp.lib" , " gdi32.lib" , " urlmon.lib" , " Comdlg32.lib" ,
321
+ WIN . glass. linkFlags = ( IS_STATIC_BUILD ? [linkFlags] : [linkFlags, " delayimp.lib" , " gdi32.lib" , " urlmon.lib" , " Comdlg32.lib" ,
317
322
" winmm.lib" , " imm32.lib" , " shell32.lib" , " Uiautomationcore.lib" , " dwmapi.lib" ,
318
323
" /DELAYLOAD:user32.dll" , " /DELAYLOAD:urlmon.dll" , " /DELAYLOAD:winmm.dll" , " /DELAYLOAD:shell32.dll" ,
319
- " /DELAYLOAD:Uiautomationcore.dll" , " /DELAYLOAD:dwmapi.dll" ]. flatten()
324
+ " /DELAYLOAD:Uiautomationcore.dll" , " /DELAYLOAD:dwmapi.dll" ]) . flatten()
320
325
WIN . glass. lib = " glass"
321
326
322
327
WIN . decora = [:]
@@ -361,7 +366,7 @@ WIN.prismD3D.nativeSource = [
361
366
WIN . prismD3D. compiler = compiler
362
367
WIN . prismD3D. ccFlags = [ccFlags, " /Ibuild/headers/PrismD3D" ]. flatten()
363
368
WIN . prismD3D. linker = linker
364
- WIN . prismD3D. linkFlags = [linkFlags, " user32.lib" ]. flatten()
369
+ WIN . prismD3D. linkFlags = ( IS_STATIC_BUILD ? [linkFlags] : [linkFlags , " user32.lib" ]) . flatten()
365
370
WIN . prismD3D. lib = " prism_d3d"
366
371
WIN . prismD3D. rcCompiler = rcCompiler;
367
372
WIN . prismD3D. rcSource = defaultRcSource
@@ -391,7 +396,7 @@ WIN.prismES2.nativeSource = [
391
396
WIN . prismES2. compiler = compiler
392
397
WIN . prismES2. ccFlags = [" /Ob1" , " /GF" , " /Gy" , " /GS" , " /DWIN32" , ccFlags]. flatten()
393
398
WIN . prismES2. linker = linker
394
- WIN . prismES2. linkFlags = [linkFlags, " /SUBSYSTEM:WINDOWS" , " opengl32.lib" , " gdi32.lib" , " user32.lib" , " kernel32.lib" ]. flatten()
399
+ WIN . prismES2. linkFlags = ( IS_STATIC_BUILD ? [linkFlags] : [linkFlags , " /SUBSYSTEM:WINDOWS" , " opengl32.lib" , " gdi32.lib" , " user32.lib" , " kernel32.lib" ]) . flatten()
395
400
WIN . prismES2. lib = " prism_es2"
396
401
WIN . prismES2. rcCompiler = rcCompiler;
397
402
WIN . prismES2. rcSource = defaultRcSource
@@ -407,7 +412,7 @@ WIN.font.compiler = compiler
407
412
WIN . font. ccFlags = [" /DJFXFONT_PLUS" , " /D_WIN32_WINNT=0x0601" , ccFlags]. flatten()
408
413
WIN . font. ccFlags - = [" /DUNICODE" , " /D_UNICODE" ]
409
414
WIN . font. linker = linker
410
- WIN . font. linkFlags = [linkFlags, " advapi32.lib" , " gdi32.lib" , " user32.lib" , " dwrite.lib" , " d2d1.lib" , " windowscodecs.lib" , " ole32.lib" ]. flatten()
415
+ WIN . font. linkFlags = ( IS_STATIC_BUILD ? [linkFlags] : [linkFlags , " advapi32.lib" , " gdi32.lib" , " user32.lib" , " dwrite.lib" , " d2d1.lib" , " windowscodecs.lib" , " ole32.lib" ]) . flatten()
411
416
WIN . font. lib = " javafx_font"
412
417
WIN . font. rcCompiler = rcCompiler;
413
418
WIN . font. rcSource = defaultRcSource
0 commit comments