Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: tools/build_shaderc.py

Issue 1930423002: Require Android SDK copy of CMake to build Vulkan on Android. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « platform_tools/android/bin/android_setup.sh ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright 2016 Google Inc. 3 # Copyright 2016 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 8
9 """ 9 """
10 Script to build the shaderc library. 10 Script to build the shaderc library.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 os.makedirs(args.output_dir) 66 os.makedirs(args.output_dir)
67 except os.error: 67 except os.error:
68 sys.exit('Error creating output dir ' + args.output_dir) 68 sys.exit('Error creating output dir ' + args.output_dir)
69 69
70 try: 70 try:
71 build_type_arg='-DCMAKE_BUILD_TYPE=' + args.build_type 71 build_type_arg='-DCMAKE_BUILD_TYPE=' + args.build_type
72 cmake_cmd = ['cmake', '-G', generator, 72 cmake_cmd = ['cmake', '-G', generator,
73 '-DSPIRV_SKIP_EXECUTABLES=ON', 73 '-DSPIRV_SKIP_EXECUTABLES=ON',
74 '-DSHADERC_ENABLE_SHARED_CRT=ON'] 74 '-DSHADERC_ENABLE_SHARED_CRT=ON']
75 if args.android_toolchain and args.android_toolchain.strip() : 75 if args.android_toolchain and args.android_toolchain.strip() :
76 cmake_cmd.append('-DCMAKE_TOOLCHAIN_FILE=' + args.src_dir +\ 76 cmake_cmd.append('-DCMAKE_TOOLCHAIN_FILE=' +\
77 '/third_party/android-cmake/android.toolchain.cmake') 77 os.environ['ANDROID_SDK_ROOT'] +\
78 '/cmake/android.toolchain.cmake')
78 cmake_cmd.append('-DANDROID_TOOLCHAIN_NAME=standalone-clang') 79 cmake_cmd.append('-DANDROID_TOOLCHAIN_NAME=standalone-clang')
79 cmake_cmd.append('-DANDROID_STANDALONE_TOOLCHAIN=' +\ 80 cmake_cmd.append('-DANDROID_STANDALONE_TOOLCHAIN=' +\
80 os.path.abspath(args.android_toolchain)) 81 os.path.abspath(args.android_toolchain))
81 cmake_cmd.extend([build_type_arg, args.src_dir]) 82 cmake_cmd.extend([build_type_arg, args.src_dir])
82 subprocess.check_call(cmake_cmd, cwd=args.output_dir) 83 subprocess.check_call(cmake_cmd, cwd=args.output_dir)
83 except subprocess.CalledProcessError as error: 84 except subprocess.CalledProcessError as error:
84 sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format( 85 sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format(
85 code = error.returncode, cmd = error.cmd, dir = args.src_dir)) 86 code = error.returncode, cmd = error.cmd, dir = args.src_dir))
86 87
87 try: 88 try:
88 subprocess.check_call(['cmake', '--build', args.output_dir, '--config', 89 subprocess.check_call(['cmake', '--build', args.output_dir, '--config',
89 args.build_type], cwd=args.output_dir) 90 args.build_type], cwd=args.output_dir)
90 except subprocess.CalledProcessError as error: 91 except subprocess.CalledProcessError as error:
91 sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format( 92 sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format(
92 code = error.returncode, cmd = error.cmd, dir = args.src_dir)) 93 code = error.returncode, cmd = error.cmd, dir = args.src_dir))
93 94
94 if __name__ == '__main__': 95 if __name__ == '__main__':
95 main() 96 main()
OLDNEW
« no previous file with comments | « platform_tools/android/bin/android_setup.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698