| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |