#!/usr/bin/env bash

if [ -z $(which cargo 2>/dev/null) ]; then
    echo "Cargo is required. Install with e.g. https://rustup.rs" >&2
    exit 1
fi

cd bind_winit

echo "Building bind-winit..."
# cargo build --package bind-winit --release
# cp target/release/libbind_winit.so ../ 2>/dev/null
# cp target/release/libbind_winit.dylib ../ 2>/dev/null
# cp target/release/libbind_winit.dll ../ 2>/dev/null

cargo build --package bind-winit
cp target/debug/libbind_winit.so ../ 2>/dev/null
cp target/debug/libbind_winit.dylib ../ 2>/dev/null
cp target/debug/libbind_winit.dll ../ 2>/dev/null

echo "Done"