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

Unified Diff: tools/build_shaderc.py

Issue 1903253003: VulkanViewer on Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gyp Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « platform_tools/android/third_party/native_app_glue/android_native_app_glue.c ('k') | tools/vulkan/Window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/build_shaderc.py
diff --git a/tools/build_shaderc.py b/tools/build_shaderc.py
index 93b42bd70e77d760efa9d7a935ce44e254222acf..0a3fc3aa2864746a8065f4c832f1ac4b07b39bcf 100644
--- a/tools/build_shaderc.py
+++ b/tools/build_shaderc.py
@@ -29,6 +29,8 @@ def main():
'Directory for cmake build')
parser.add_argument('-p', '--project_type', required=True, help=
'Project type to use. Must be "ninja", "MSVS2013", or "MSVS2015"')
+ parser.add_argument('-c', '--android_toolchain', required=False, help=
+ 'Location of standalone android toolchain to use for crosscompiling')
args = parser.parse_args()
args.src_dir = os.path.abspath(args.src_dir)
@@ -44,12 +46,9 @@ def main():
else:
args.exit('Invalid build type: ' + args.build_type);
- if args.arch_type == 'x86':
- vs_arch = ''
- elif args.arch_type == 'x86_64':
+ vs_arch = ''
+ if args.arch_type == 'x86_64':
vs_arch = ' Win64'
- else:
- sys.exit('Invalid arch type: ' + args.arch_type);
if args.project_type == 'ninja':
generator = 'Ninja'
@@ -70,9 +69,17 @@ def main():
try:
build_type_arg='-DCMAKE_BUILD_TYPE=' + args.build_type
- subprocess.check_call(['cmake', '-G', generator,
- '-DSPIRV_SKIP_EXECUTABLES=ON', '-DSHADERC_ENABLE_SHARED_CRT=ON',
- args.src_dir, build_type_arg], cwd=args.output_dir)
+ cmake_cmd = ['cmake', '-G', generator,
+ '-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('-DANDROID_TOOLCHAIN_NAME=standalone-clang')
+ cmake_cmd.append('-DANDROID_STANDALONE_TOOLCHAIN=' +\
+ os.path.abspath(args.android_toolchain))
+ cmake_cmd.extend([build_type_arg, args.src_dir])
+ subprocess.check_call(cmake_cmd, cwd=args.output_dir)
except subprocess.CalledProcessError as error:
sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format(
code = error.returncode, cmd = error.cmd, dir = args.src_dir))
@@ -86,4 +93,3 @@ def main():
if __name__ == '__main__':
main()
-
« no previous file with comments | « platform_tools/android/third_party/native_app_glue/android_native_app_glue.c ('k') | tools/vulkan/Window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698