zcash-android-wallet-sdk/build-rust.bat

50 lines
1.3 KiB
Batchfile

@if "%DEBUG%" == "" @echo off
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
@rem check for cargo installation
cargo --version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto cargoFound
echo Cargo appears to be missing.
echo Go to https://rustup.rs/ to install it, and then run this script again.
exit /b 1
:cargoFound
echo Cargo found!
@rem update android targets
echo Updating android targets...
echo rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
echo Done.
@rem check for standalone NDK
call build-ndk-standalone.bat
if %ERRORLEVEL% neq 0 exit /b 1
@rem add NDK binaries to path so the cc crate can find them
set PATH=%DIRNAME%\out\ndk\standalone\arm\bin;%PATH%
set PATH=%DIRNAME%\out\ndk\standalone\arm64\bin;%PATH%
set PATH=%DIRNAME%\out\ndk\standalone\x86\bin;%PATH%
echo Building...
echo building aarch64...
cargo build --target aarch64-linux-android --release
if %ERRORLEVEL% neq 0 exit /b 10
echo building i686...
cargo build --target i686-linux-android --release
if %ERRORLEVEL% neq 0 exit /b 20
echo building armv7...
cargo build --target armv7-linux-androideabi --release
if %ERRORLEVEL% neq 0 exit /b 30
echo Done.