first commit
This commit is contained in:
33
win.sh
Executable file
33
win.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user