Require Android SDK copy of CMake to build Vulkan on Android.
authordjsollen <djsollen@google.com>
Fri, 29 Apr 2016 15:09:43 +0000 (08:09 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 29 Apr 2016 15:09:43 +0000 (08:09 -0700)
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930423002

Review-Url: https://codereview.chromium.org/1930423002

DEPS
platform_tools/android/bin/android_setup.sh
tools/build_shaderc.py

diff --git a/DEPS b/DEPS
index d7ec409..b06c80b 100644 (file)
--- a/DEPS
+++ b/DEPS
@@ -53,7 +53,6 @@ deps = {
   "third_party/externals/shaderc2/third_party/googletest" : "https://github.com/google/googletest.git@d225acc90bc3a8c420a9bcd1f033033c1ccd7fe0",
   "third_party/externals/shaderc2/third_party/glslang" : "https://github.com/google/glslang.git@e1cd410d9c03a24c00c570c91a99cad88bb475d1",
   "third_party/externals/shaderc2/third_party/spirv-tools" : "https://github.com/KhronosGroup/SPIRV-Tools.git@009c4358b5a1c93203166b3ed60a548f63522e81",
-  "third_party/externals/shaderc2/third_party/android-cmake" : "https://github.com/taka-no-me/android-cmake.git@556cc14296c226f753a3778d99d8b60778b7df4f",
 }
 
 deps_os = {
index 503ee02..f242bfa 100755 (executable)
@@ -52,10 +52,6 @@ if [ "$USE_CLANG" == "true" ]; then
   export GYP_DEFINES="skia_clang_build=1 $GYP_DEFINES"
 fi
 
-if [ "$SKIA_VULKAN" == "true" ]; then
-  export GYP_DEFINES="skia_vulkan=1 $GYP_DEFINES"
-fi
-
 function verbose {
   if [[ -n $VERBOSE ]]; then
     echo $@
@@ -89,6 +85,17 @@ if [ -z "$ANDROID_HOME" ]; then
   exportVar ANDROID_HOME $ANDROID_SDK_ROOT
 fi
 
+if [ "$SKIA_VULKAN" == "true" ]; then
+  export GYP_DEFINES="skia_vulkan=1 $GYP_DEFINES"
+  # add cmake from the SDK to your path if it doesn't exist
+  if [ ! -d "${ANDROID_SDK_ROOT}/cmake" ]; then
+     echo "The Android SDK Tools version of CMake is required to build Vulkan. ${ANDROID_SDK_ROOT}/cmake"
+     exit 1
+  else
+    export PATH=${ANDROID_SDK_ROOT}/cmake/bin:$PATH
+  fi
+fi
+
 # Helper function to configure the GYP defines to the appropriate values
 # based on the target device.
 setup_device() {
index 0a3fc3a..d1ece21 100644 (file)
@@ -73,8 +73,9 @@ def main():
                  '-DSPIRV_SKIP_EXECUTABLES=ON',
                  '-DSHADERC_ENABLE_SHARED_CRT=ON']
     if args.android_toolchain and args.android_toolchain.strip() :
-      cmake_cmd.append('-DCMAKE_TOOLCHAIN_FILE=' + args.src_dir +\
-                       '/third_party/android-cmake/android.toolchain.cmake')
+      cmake_cmd.append('-DCMAKE_TOOLCHAIN_FILE=' +\
+                       os.environ['ANDROID_SDK_ROOT'] +\
+                       '/cmake/android.toolchain.cmake')
       cmake_cmd.append('-DANDROID_TOOLCHAIN_NAME=standalone-clang')
       cmake_cmd.append('-DANDROID_STANDALONE_TOOLCHAIN=' +\
                        os.path.abspath(args.android_toolchain))