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

Side by Side Diff: tools/build_shaderc.py

Issue 1854733004: Respect build type arg in build_shaderc.py (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 else: 56 else:
57 sys.exit('Invalid project type: ' + args.project_type); 57 sys.exit('Invalid project type: ' + args.project_type);
58 58
59 if not os.path.isdir(args.output_dir): 59 if not os.path.isdir(args.output_dir):
60 try: 60 try:
61 os.makedirs(args.output_dir) 61 os.makedirs(args.output_dir)
62 except os.error: 62 except os.error:
63 sys.exit('Error creating output dir ' + args.output_dir) 63 sys.exit('Error creating output dir ' + args.output_dir)
64 64
65 try: 65 try:
66 build_type_arg='-DCMAKE_BUILD_TYPE=' + args.build_type
66 subprocess.check_call(['cmake', '-G', generator, 67 subprocess.check_call(['cmake', '-G', generator,
67 '-DSPIRV_SKIP_EXECUTABLES=ON', '-DSHADERC_ENABLE_SHARED_CRT=ON', 68 '-DSPIRV_SKIP_EXECUTABLES=ON', '-DSHADERC_ENABLE_SHARED_CRT=ON',
68 args.src_dir], cwd=args.output_dir) 69 args.src_dir, build_type_arg], cwd=args.output_dir)
69 except subprocess.CalledProcessError as error: 70 except subprocess.CalledProcessError as error:
70 sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format( 71 sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format(
71 code = error.returncode, cmd = error.cmd, dir = args.src_dir)) 72 code = error.returncode, cmd = error.cmd, dir = args.src_dir))
72 73
73 try: 74 try:
74 subprocess.check_call(['cmake', '--build', args.output_dir, '--config', 75 subprocess.check_call(['cmake', '--build', args.output_dir, '--config',
75 args.build_type], cwd=args.output_dir) 76 args.build_type], cwd=args.output_dir)
76 except subprocess.CalledProcessError as error: 77 except subprocess.CalledProcessError as error:
77 sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format( 78 sys.exit('Error (ret code: {code}) calling "{cmd}" in {dir}'.format(
78 code = error.returncode, cmd = error.cmd, dir = args.src_dir)) 79 code = error.returncode, cmd = error.cmd, dir = args.src_dir))
79 80
80 if __name__ == '__main__': 81 if __name__ == '__main__':
81 main() 82 main()
82 83
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698