py2pyd 0.1.6

A Rust-based tool to compile Python modules to pyd files
Documentation
# Cross.toml - Configuration for cross-compilation with OpenSSL support
# Place this file at the root of your project to resolve OpenSSL compilation issues

[build.env]
passthrough = [
    "OPENSSL_STATIC",
    "OPENSSL_LIB_DIR",
    "OPENSSL_INCLUDE_DIR",
    "PKG_CONFIG_ALLOW_CROSS",
    # mimalloc cross-compilation environment variables
    "CARGO_CFG_TARGET_OS",
    "CARGO_CFG_TARGET_ARCH",
    "CARGO_CFG_TARGET_ENV",
    "PKG_CONFIG_PATH",
    "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER",
    "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER",
    # mimalloc cross-compilation support
    "CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG",
    "CC_i686_pc_windows_gnu",
    "CXX_i686_pc_windows_gnu",
    "AR_i686_pc_windows_gnu",
    "CC_x86_64_pc_windows_gnu",
    "CXX_x86_64_pc_windows_gnu",
    "AR_x86_64_pc_windows_gnu"
]

# Configuration for musl targets
[target.x86_64-unknown-linux-musl]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main"
pre-build = [
    "dpkg --add-architecture amd64",
    "apt-get update && apt-get install -y libssl-dev:amd64 pkg-config"
]

[target.aarch64-unknown-linux-musl]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main"
pre-build = [
    "dpkg --add-architecture arm64",
    "apt-get update && apt-get install -y libssl-dev:arm64 pkg-config"
]

[target.aarch64-unknown-linux-musl.env]
# Fix linker architecture mismatch
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER = "aarch64-linux-musl-gcc"
CC_aarch64_unknown_linux_musl = "aarch64-linux-musl-gcc"
CXX_aarch64_unknown_linux_musl = "aarch64-linux-musl-g++"
AR_aarch64_unknown_linux_musl = "aarch64-linux-musl-ar"
# Disable mimalloc for musl targets
CARGO_CFG_TARGET_OS = "linux"
CARGO_CFG_TARGET_ENV = "musl"
CARGO_FEATURE_MIMALLOC = "0"
MIMALLOC_OVERRIDE = "0"
# Fix Rust toolchain issues
RUSTFLAGS = "-C target-feature=-crt-static"

# Configuration for GNU targets
[target.aarch64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main"
pre-build = [
    "dpkg --add-architecture arm64",
    "apt-get update && apt-get install -y libssl-dev:arm64 pkg-config"
]

# Windows targets
[target.x86_64-pc-windows-gnu]
image = "ghcr.io/cross-rs/x86_64-pc-windows-gnu:main"
pre-build = [
    "apt-get update && apt-get install -y gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64"
]

[target.x86_64-pc-windows-gnu.env]
CC_x86_64_pc_windows_gnu = "x86_64-w64-mingw32-gcc-posix"
CXX_x86_64_pc_windows_gnu = "x86_64-w64-mingw32-g++-posix"
AR_x86_64_pc_windows_gnu = "x86_64-w64-mingw32-ar"
CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = "true"
# Disable mimalloc for Windows GNU targets to avoid compilation errors
CARGO_CFG_TARGET_OS = "windows"
CARGO_CFG_TARGET_ENV = "gnu"
# Force disable mimalloc features
CARGO_FEATURE_MIMALLOC = "0"
MIMALLOC_OVERRIDE = "0"

# Add i686 Windows target for better compatibility
[target.i686-pc-windows-gnu]
image = "ghcr.io/cross-rs/i686-pc-windows-gnu:main"
pre-build = [
    "apt-get update && apt-get install -y gcc-mingw-w64-i686 g++-mingw-w64-i686"
]

[target.i686-pc-windows-gnu.env]
CC_i686_pc_windows_gnu = "i686-w64-mingw32-gcc-posix"
CXX_i686_pc_windows_gnu = "i686-w64-mingw32-g++-posix"
AR_i686_pc_windows_gnu = "i686-w64-mingw32-ar"
CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = "true"
# Disable mimalloc for Windows GNU targets to avoid compilation errors
CARGO_CFG_TARGET_OS = "windows"
CARGO_CFG_TARGET_ENV = "gnu"
# Force disable mimalloc features
CARGO_FEATURE_MIMALLOC = "0"
MIMALLOC_OVERRIDE = "0"

[target.aarch64-pc-windows-msvc]
image = "ghcr.io/cross-rs/aarch64-pc-windows-msvc:main"

# macOS targets (when cross-compiling from Linux)
[target.x86_64-apple-darwin]
image = "ghcr.io/cross-rs/x86_64-apple-darwin:main"

[target.aarch64-apple-darwin]
image = "ghcr.io/cross-rs/aarch64-apple-darwin:main"