Add NDK binaries to path so the cc crate can find them

This commit is contained in:
Jack Grigg 2018-11-21 16:24:40 +00:00
parent 904099d761
commit c479e67667
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
2 changed files with 11 additions and 3 deletions

View File

@ -3,6 +3,9 @@
@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
@ -25,6 +28,11 @@ 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

View File

@ -26,12 +26,12 @@ echo "Android targets found!"
echo "Building..."
echo " building aarch64..."
cargo build --target aarch64-linux-android --release || exit 10
PATH="$PATH:$(pwd)/out/ndk/standalone/arm64/bin" cargo build --target aarch64-linux-android --release || exit 10
echo " building i686..."
cargo build --target i686-linux-android --release || exit 20
PATH="$PATH:$(pwd)/out/ndk/standalone/x86/bin" cargo build --target i686-linux-android --release || exit 20
echo " building armv7..."
cargo build --target armv7-linux-androideabi --release || exit 30
PATH="$PATH:$(pwd)/out/ndk/standalone/arm/bin" cargo build --target armv7-linux-androideabi --release || exit 30
echo "Done."