@ -236,7 +236,7 @@ pub fn build(b: *std.Build) !void {
const wrap_exe = b . addExecutable ( . {
const wrap_exe = b . addExecutable ( . {
. name = " wrapfiletofile " ,
. name = " wrapfiletofile " ,
. root_source_file = b . path ( " tools/wrapfiletofile.zig " ) ,
. root_source_file = b . path ( " tools/wrapfiletofile.zig " ) ,
. target = b . host ,
. target = b . graph . host ,
} ) ;
} ) ;
/ / const tool_step = b . addRunArtifact ( tool ) ;
/ / const tool_step = b . addRunArtifact ( tool ) ;
const wrap_run = b . addRunArtifact ( wrap_exe ) ;
const wrap_run = b . addRunArtifact ( wrap_exe ) ;
@ -1338,13 +1338,17 @@ pub fn build(b: *std.Build) !void {
tcl_objs_static . addIncludePath ( b . path ( tcl_source_folder + + " /compat/zlib " ) ) ;
tcl_objs_static . addIncludePath ( b . path ( tcl_source_folder + + " /compat/zlib " ) ) ;
tcl_objs_static . addIncludePath ( b . path ( tcl_source_folder + + " /compat/zlib/contrib/minizip " ) ) ; / / only required by tclZipfs - but ok for all ?
tcl_objs_static . addIncludePath ( b . path ( tcl_source_folder + + " /compat/zlib/contrib/minizip " ) ) ; / / only required by tclZipfs - but ok for all ?
/ / tclMain . c needs to be built twice on windows - with and without unicode flags
/ / tclMain . c needs to be built twice on windows - with and without unicode flags .
if ( target . result . os . tag = = . windows ) {
/ / The UNICODE copy is already produced by the generic sources loop ( build_specials
tcl_objs_static . addCSourceFile ( . {
/ / maps tclMain - > mainw_flags ) ; the ansi copy is added to the exe below . A second
. file = b . path ( tcl_source_folder + + " /generic/tclMain.c " ) ,
/ / explicit UNICODE add here was harmless under zig 0.14 . 0 - dev . 2074 ( the duplicate
. flags = mainw_flags . items ,
/ / archive member was never extracted ) but zig 0.14 . 1 links it - > duplicate symbols .
} ) ;
/ / if ( target . result . os . tag = = . windows ) {
}
/ / tcl_objs_static . addCSourceFile ( . {
/ / . file = b . path ( tcl_source_folder + + " /generic/tclMain.c " ) ,
/ / . flags = mainw_flags . items ,
/ / } ) ;
/ / }
var current_flagset : std . ArrayList ( [ ] const u8 ) = undefined ;
var current_flagset : std . ArrayList ( [ ] const u8 ) = undefined ;
for ( tcl_objs_static_sources . items ) | src | {
for ( tcl_objs_static_sources . items ) | src | {
if ( build_specials . get ( std . fs . path . stem ( src ) ) ) | val | {
if ( build_specials . get ( std . fs . path . stem ( src ) ) ) | val | {
@ -1632,9 +1636,21 @@ pub fn build(b: *std.Build) !void {
/ / tclMain needs to be compiled twice on windows - with and without unicode
/ / tclMain needs to be compiled twice on windows - with and without unicode
/ / we have already configured the one in the sources list to compile with mainw_flags ( DUNICODE etc )
/ / we have already configured the one in the sources list to compile with mainw_flags ( DUNICODE etc )
if ( target . result . os . tag = = . windows ) {
if ( target . result . os . tag = = . windows ) {
/ / The ansi copy must NOT see UNICODE : undefine explicitly ( the zig cc driver can
/ / supply windows - default defines - observed with zig 0.14 . 1 as duplicate
/ / Tcl_MainExW / common symbols vs the mainw copy ) and use upstream ' s
/ / TCL_ASCII_MAIN guard so only the ascii Tcl_MainEx variant is emitted .
var mainansi_flags = std . ArrayList ( [ ] const u8 ) . init ( b . allocator ) ;
defer mainansi_flags . deinit ( ) ;
try mainansi_flags . appendSlice ( tclobjs_flags . items ) ;
try mainansi_flags . appendSlice ( & . {
" -UUNICODE " ,
" -U_UNICODE " ,
" -DTCL_ASCII_MAIN " ,
} ) ;
tclsh_exe . addCSourceFile ( . {
tclsh_exe . addCSourceFile ( . {
. file = b . path ( tcl_source_folder + + " /generic/tclMain.c " ) ,
. file = b . path ( tcl_source_folder + + " /generic/tclMain.c " ) ,
. flags = tclobjs_flags . items ,
. flags = mainansi _flags. items ,
} ) ;
} ) ;
}
}
tclsh_exe . addCSourceFile ( . {
tclsh_exe . addCSourceFile ( . {