windows_do 953 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. # OSX
  3. # brew install mingw-w64
  4. build() {
  5. ARCH=$1
  6. # libuv
  7. export CC="$ARCH-w64-mingw32-gcc"
  8. if ! command -v "$CC" > /dev/null; then
  9. echo "Skipping build for $ARCH because $CC is not installed"
  10. return
  11. fi
  12. if ! [ -d "$(rustc --target "$ARCH-pc-windows-gnu" --print target-libdir)" ]; then
  13. echo "Skipping build for $ARCH because rust target $ARCH-pc-windows-gnu is not installed"
  14. echo "You can install it with rustup using: \`rustup target add $ARCH-pc-windows-gnu\`"
  15. return
  16. fi
  17. # Used by cjdns libuv build
  18. export AR="$ARCH-w64-mingw32-ar"
  19. export RANLIB="$ARCH-w64-mingw32-gcc-ranlib"
  20. export TARGET="$ARCH-w64-mingw32"
  21. # Used by cjdns nodejs build
  22. export CROSS=1
  23. export SYSTEM=win32
  24. cargo build --release -vv --target="$ARCH-pc-windows-gnu"
  25. }
  26. # build i686 - impossible because rust: https://github.com/rust-lang/rust/issues/12859
  27. build x86_64