Files
rust_imgapi/win.sh
Beyhan Oğur dd72c6220d first commit
2026-04-26 22:32:52 +03:00

33 lines
964 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# --- Ayarlar ---
TARGET="x86_64-pc-windows-gnu"
APP_NAME="projem" # Buraya projenin adını yazabilirsin
echo "🚀 Windows için derleme işlemi başlıyor..."
# 1. Hedef (Target) yüklü mü kontrol et
if ! rustup target list | grep -q "$TARGET (installed)"; then
echo "📦 $TARGET hedefi ekleniyor..."
rustup target add $TARGET
fi
# 2. .cargo/config.toml dosyasını kontrol et/oluştur
# Bu kısım linker hatası almanı engeller
mkdir -p .cargo
if [ ! -f .cargo/config.toml ]; then
echo "⚙️ Linker ayarları yapılandırılıyor..."
echo "[target.$TARGET]" > .cargo/config.toml
echo "linker = \"x86_64-w64-mingw32-gcc\"" >> .cargo/config.toml
fi
# 3. Derleme
echo "🏗️ Kompile ediliyor (Release modu)..."
cargo build --target $TARGET --release
if [ $? -eq 0 ]; then
echo "✅ Başarılı!"
echo "📂 Dosya konumu: target/$TARGET/release/"
else
echo "❌ Derleme sırasında bir hata oluştu."
fi