I don't know if this would be in-scope for the project or not but...
I found it difficult to cross-compile from Linux to Windows. While possible, I think it could be more ergonomic.
The command I eventually landed on looks like this:
RUSTFLAGS="-L scratch/tcl-${tcl_tag}/win/build"\
PKG_CONFIG_ALLOW_CROSS=1\
BINDGEN_EXTRA_CLANG_ARGS='-D__int64="long long" -Dssize_t=int64_t'\
cargo build --target=x86_64-pc-windows-gnu --release
Where scratch/tcl-${tcl_tag}/win/build is the relative path where I have tcl86.dll built. (Additionally, I have to create a symlink from tcl8.6.dll -> tcl86.dll for the tcl crate to find the lib, based on the default make behavior from the Tcl source.)
Ideally I'd like to be able to configure the path to the Tcl lib elsewhere and be able to just run cargo build --target=x86_64-pc-windows-gnu --release to build an executable.
In particular, the BINDGEN_EXTRA_CLANG_ARGS='-D__int64="long long" -Dssize_t=int64_t' bit is a bit silly, apparently some sort of clang behavior that deviates from GCC. (So far as I can tell, __int64 is only recognized by MSVC, although clang already appears to define __GNUC__ by default, so I have no idea why __int64 is reached).
I'd also like to say that you're bindings are working terrifically! I've had no problems with the code I've written to consume the tcl crate, and I've had reports that it's working under Windows (through a cross-compile build I've handed out) as well.
I don't know if this would be in-scope for the project or not but...
I found it difficult to cross-compile from Linux to Windows. While possible, I think it could be more ergonomic.
The command I eventually landed on looks like this:
Where
scratch/tcl-${tcl_tag}/win/buildis the relative path where I havetcl86.dllbuilt. (Additionally, I have to create a symlink fromtcl8.6.dll->tcl86.dllfor the tcl crate to find the lib, based on the defaultmakebehavior from the Tcl source.)Ideally I'd like to be able to configure the path to the Tcl lib elsewhere and be able to just run
cargo build --target=x86_64-pc-windows-gnu --releaseto build an executable.In particular, the
BINDGEN_EXTRA_CLANG_ARGS='-D__int64="long long" -Dssize_t=int64_t'bit is a bit silly, apparently some sort of clang behavior that deviates from GCC. (So far as I can tell,__int64is only recognized by MSVC, although clang already appears to define__GNUC__by default, so I have no idea why__int64is reached).I'd also like to say that you're bindings are working terrifically! I've had no problems with the code I've written to consume the
tclcrate, and I've had reports that it's working under Windows (through a cross-compile build I've handed out) as well.