Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Android NDK. #530

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions kokoro/android-release/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,34 @@ TARGET_ARCH=$1
# Get NINJA.
wget -q https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip
unzip -q ninja-linux.zip
export PATH="$PWD:$PATH"
export BUILD_NDK=ON
export ANDROID_NDK=/opt/android-ndk-r15c
git clone --depth=1 https://github.com/taka-no-me/android-cmake.git android-cmake
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes. yep, that's no longer supported now that Android builds support Cmake. The supporting toolchain file is in the NDK now, as you discovered.

export TOOLCHAIN_PATH=$PWD/android-cmake/android.toolchain.cmake
NINJA=$PWD/ninja

# Get Android NDK.
wget https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot -q here, will add.
This is a 500MB download but took less than five seconds on the bot.
It makes the script self-contained instead of depending on bot setup which no one knows what it is or how to change.

unzip -q android-ndk-r18b-linux-x86_64.zip
NDK=$PWD/android-ndk-r18b

cd $SRC/third_party
git clone https://github.com/google/googletest.git
git clone https://github.com/google/glslang.git
git clone https://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools
git clone https://github.com/KhronosGroup/SPIRV-Headers.git spirv-headers
git clone https://github.com/google/re2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. We don't cross-compile the test code for the ABIs.

git clone https://github.com/google/effcee

cd $SRC/
mkdir build
mkdir $SRC/build
cd $SRC/build

# Invoke the build.
BUILD_SHA=${KOKORO_GITHUB_COMMIT:-$KOKORO_GITHUB_PULL_REQUEST_COMMIT}
echo $(date): Starting build...
cmake -DRE2_BUILD_TESTING=OFF -GNinja -DCMAKE_BUILD_TYPE=Release -DANDROID_NATIVE_API_LEVEL=android-14 -DANDROID_ABI=$TARGET_ARCH -DSHADERC_SKIP_TESTS=ON -DSPIRV_SKIP_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_PATH -DANDROID_NDK=$ANDROID_NDK ..

cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=$NINJA -DANDROID_ABI=$TARGET_ARCH -DSHADERC_SKIP_TESTS=ON -DSPIRV_SKIP_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake -DANDROID_NDK=$NDK ..

echo $(date): Build glslang...
ninja glslangValidator
$NINJA glslangValidator

echo $(date): Build everything...
ninja
$NINJA

echo $(date): Check Shaderc for copyright notices...
ninja check-copyright
$NINJA check-copyright

echo $(date): Build completed.