@@ -84,6 +84,16 @@ if (Deno.build.os === "windows") {
8484 "TOP=..\\" ,
8585 CFLAGS ,
8686 ) ;
87+
88+ // Strip the Windows DLL
89+ console . log ( `%cStripping ${ lib } ...` , "color: #888" ) ;
90+ try {
91+ // Use link.exe with /SUBSYSTEM:WINDOWS /STRIP options
92+ $ ( "link" , `/EDIT` , `/SUBSYSTEM:WINDOWS` , `/STRIP` , `${ lib } ` ) ;
93+ } catch ( e ) {
94+ console . log ( `%cWarning: Stripping failed, using unstripped library: ${ e . message } ` , "color: #ff0" ) ;
95+ }
96+
8797 await Deno . copyFile (
8898 new URL ( `../sqlite/build/${ lib } ` , import . meta. url ) ,
8999 new URL ( `../build/${ libWithArch } ` , import . meta. url ) ,
@@ -104,10 +114,19 @@ if (Deno.build.os === "windows") {
104114 "8" ,
105115 CFLAGS ,
106116 ) ;
117+
118+ // Strip the library to remove debug symbols and reduce size
119+ console . log ( `%cStripping ${ lib } ...` , "color: #888" ) ;
120+ try {
121+ $ ( "strip" , `--strip-unneeded` , `.libs/${ lib } ` ) ;
122+ } catch ( e ) {
123+ console . log ( `%cWarning: Stripping failed, using unstripped library: ${ e . message } ` , "color: #ff0" ) ;
124+ }
125+
107126 await Deno . copyFile (
108127 new URL ( `../sqlite/build/.libs/${ lib } ` , import . meta. url ) ,
109128 new URL ( `../build/${ libWithArch } ` , import . meta. url ) ,
110129 ) ;
111130}
112131
113- console . log ( `%c${ libWithArch } built` , "color: #0f0" ) ;
132+ console . log ( `%c${ libWithArch } built and stripped ` , "color: #0f0" ) ;
0 commit comments