| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 3 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license | 5 # Use of this source code is governed by a BSD-style license |
| 6 # that can be found in the LICENSE file in the root of the source | 6 # that can be found in the LICENSE file in the root of the source |
| 7 # tree. An additional intellectual property rights grant can be found | 7 # tree. An additional intellectual property rights grant can be found |
| 8 # in the file PATENTS. All contributing project authors may | 8 # in the file PATENTS. All contributing project authors may |
| 9 # be found in the AUTHORS file in the root of the source tree. | 9 # be found in the AUTHORS file in the root of the source tree. |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 if build_type == 'static_only': | 109 if build_type == 'static_only': |
| 110 gn_target_name = 'rtc_sdk_objc' | 110 gn_target_name = 'rtc_sdk_objc' |
| 111 elif build_type == 'framework': | 111 elif build_type == 'framework': |
| 112 gn_target_name = 'rtc_sdk_framework_objc' | 112 gn_target_name = 'rtc_sdk_framework_objc' |
| 113 gn_args.append('enable_dsyms=true') | 113 gn_args.append('enable_dsyms=true') |
| 114 gn_args.append('enable_stripping=true') | 114 gn_args.append('enable_stripping=true') |
| 115 else: | 115 else: |
| 116 raise ValueError('Build type "%s" is not supported.' % build_type) | 116 raise ValueError('Build type "%s" is not supported.' % build_type) |
| 117 | 117 |
| 118 logging.info('Building WebRTC with args: %s', ' '.join(gn_args)) | 118 logging.info('Building WebRTC with args: %s', ' '.join(gn_args)) |
| 119 |
| 119 cmd = ['gn', 'gen', output_dir, | 120 cmd = ['gn', 'gen', output_dir, |
| 120 '--args=' + ' '.join(gn_args + extra_gn_args)] | 121 '--args=' + ' '.join(gn_args + extra_gn_args)] |
| 121 _RunCommand(cmd) | 122 _RunCommand(cmd) |
| 122 logging.info('Building target: %s', gn_target_name) | 123 logging.info('Building target: %s', gn_target_name) |
| 124 |
| 123 cmd = ['ninja', '-C', output_dir, gn_target_name] | 125 cmd = ['ninja', '-C', output_dir, gn_target_name] |
| 126 if use_goma: |
| 127 cmd.extend(['-j', '200']) |
| 124 _RunCommand(cmd) | 128 _RunCommand(cmd) |
| 125 | 129 |
| 126 # Strip debug symbols to reduce size. | 130 # Strip debug symbols to reduce size. |
| 127 if build_type == 'static_only': | 131 if build_type == 'static_only': |
| 128 gn_target_path = os.path.join(output_dir, 'obj', 'webrtc', 'sdk', | 132 gn_target_path = os.path.join(output_dir, 'obj', 'webrtc', 'sdk', |
| 129 'lib%s.a' % gn_target_name) | 133 'lib%s.a' % gn_target_name) |
| 130 cmd = ['strip', '-S', gn_target_path, '-o', | 134 cmd = ['strip', '-S', gn_target_path, '-o', |
| 131 os.path.join(output_dir, 'lib%s.a' % gn_target_name)] | 135 os.path.join(output_dir, 'lib%s.a' % gn_target_name)] |
| 132 _RunCommand(cmd) | 136 _RunCommand(cmd) |
| 133 | 137 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 'Set :CFBundleVersion ' + version_number, infoplist_path] | 216 'Set :CFBundleVersion ' + version_number, infoplist_path] |
| 213 _RunCommand(cmd) | 217 _RunCommand(cmd) |
| 214 _RunCommand(['plutil', '-convert', 'binary1', infoplist_path]) | 218 _RunCommand(['plutil', '-convert', 'binary1', infoplist_path]) |
| 215 | 219 |
| 216 logging.info('Done.') | 220 logging.info('Done.') |
| 217 return 0 | 221 return 0 |
| 218 | 222 |
| 219 | 223 |
| 220 if __name__ == '__main__': | 224 if __name__ == '__main__': |
| 221 sys.exit(main()) | 225 sys.exit(main()) |
| OLD | NEW |