# This Dockerfile produces a base image for builds. # It includes all dependencies necessary to cross-compile for Windows/MacOS/Linux. FROM crazymax/osxcross:latest-ubuntu AS osxcross FROM rust:latest RUN rustup target add x86_64-pc-windows-msvc && \ rustup target add x86_64-apple-darwin && \ rustup target add aarch64-apple-darwin && \ apt-get update && \ apt-get install -y clang-19 lld-19 libc6-dev libasound2-dev libudev-dev genisoimage mingw-w64 && \ cargo install cargo-bundle xwin && \ xwin --accept-license splat --output xwin && \ rm -rf .xwin-cache && \ ln -s $(which clang-19) /usr/bin/clang && \ ln -s $(which clang++-19) /usr/bin/clang++ COPY --from=osxcross /osxcross /osxcross ENV PATH="/osxcross/bin:$PATH" \ LD_LIBRARY_PATH="/osxcross/lib" \ CC="clang-19" CXX="clang++-19" AR="llvm-ar-19" \ CC_x86_64-apple-darwin="o64-clang" \ CXX_x86_64-apple-darwin="o64-clang++" \ CC_aarch64-apple-darwin="oa64-clang" \ CXX_aarch64-apple-darwin="o6a4-clang++" \ CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER="lld-link-19" \ CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER="o64-clang" \ CARGO_TARGET_X86_64_APPLE_DARWIN_AR="llvm-ar-19" \ CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER="oa64-clang" \ CARGO_TARGET_AARCH64_APPLE_DARWIN_AR="llvm-ar-19" \ CROSS_COMPILE="setting-this-to-silence-a-warning-" \ RC_PATH="llvm-rc-19" \ RUSTFLAGS="-Lnative=/xwin/crt/lib/x86_64 -Lnative=/xwin/sdk/lib/um/x86_64 -Lnative=/xwin/sdk/lib/ucrt/x86_64" \ MACOSX_DEPLOYMENT_TARGET="14.5"