| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Script to build binary components of the SDK. | 6 """Script to build binary components of the SDK. |
| 7 | 7 |
| 8 This script builds binary components of the Native Client SDK, create tarballs | 8 This script builds binary components of the Native Client SDK, create tarballs |
| 9 for them, and uploads them to Google Cloud Storage. | 9 for them, and uploads them to Google Cloud Storage. |
| 10 | 10 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 def NinjaBuild(targets, out_dir): | 194 def NinjaBuild(targets, out_dir): |
| 195 if type(targets) is not list: | 195 if type(targets) is not list: |
| 196 targets = [targets] | 196 targets = [targets] |
| 197 out_config_dir = os.path.join(out_dir, 'Release') | 197 out_config_dir = os.path.join(out_dir, 'Release') |
| 198 buildbot_common.Run(['ninja', '-C', out_config_dir] + targets, cwd=SRC_DIR) | 198 buildbot_common.Run(['ninja', '-C', out_config_dir] + targets, cwd=SRC_DIR) |
| 199 | 199 |
| 200 | 200 |
| 201 def GypNinjaBuild(arch, gyp_py_script, gyp_file, targets, out_dir): | 201 def GypNinjaBuild(arch, gyp_py_script, gyp_file, targets, out_dir): |
| 202 gyp_env = dict(os.environ) | 202 gyp_env = dict(os.environ) |
| 203 gyp_env['GYP_GENERATORS'] = 'ninja' | 203 gyp_defines = [] |
| 204 gyp_defines = ['nacl_allow_thin_archives=0'] | |
| 205 if options.mac_sdk: | 204 if options.mac_sdk: |
| 206 gyp_defines.append('mac_sdk=%s' % options.mac_sdk) | 205 gyp_defines.append('mac_sdk=%s' % options.mac_sdk) |
| 207 if arch: | 206 if arch: |
| 208 gyp_defines.append('target_arch=%s' % arch) | 207 gyp_defines.append('target_arch=%s' % arch) |
| 209 if arch == 'arm': | 208 if arch == 'arm': |
| 210 gyp_env['GYP_CROSSCOMPILE'] = '1' | 209 gyp_env['GYP_CROSSCOMPILE'] = '1' |
| 211 if options.no_arm_trusted: | 210 if options.no_arm_trusted: |
| 212 gyp_defines.append('disable_cross_trusted=1') | 211 gyp_defines.append('disable_cross_trusted=1') |
| 213 if PLATFORM == 'mac': | |
| 214 gyp_defines.append('clang=1') | |
| 215 | 212 |
| 216 gyp_env['GYP_DEFINES'] = ' '.join(gyp_defines) | 213 gyp_env['GYP_DEFINES'] = ' '.join(gyp_defines) |
| 217 generator_flags = ['-G', 'output_dir=%s' % out_dir] | 214 generator_flags = ['-G', 'output_dir=%s' % out_dir] |
| 218 depth = '--depth=.' | 215 depth = '--depth=.' |
| 219 cmd = [sys.executable, gyp_py_script, gyp_file, depth] + generator_flags | 216 cmd = [sys.executable, gyp_py_script, gyp_file, depth] + generator_flags |
| 220 buildbot_common.Run(cmd, cwd=SRC_DIR, env=gyp_env) | 217 buildbot_common.Run(cmd, cwd=SRC_DIR, env=gyp_env) |
| 221 NinjaBuild(targets, out_dir) | 218 NinjaBuild(targets, out_dir) |
| 222 | 219 |
| 223 | 220 |
| 224 def GetToolsFiles(): | 221 def GetToolsFiles(): |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 if options.upload: | 543 if options.upload: |
| 547 UploadArchives() | 544 UploadArchives() |
| 548 | 545 |
| 549 return 0 | 546 return 0 |
| 550 | 547 |
| 551 if __name__ == '__main__': | 548 if __name__ == '__main__': |
| 552 try: | 549 try: |
| 553 sys.exit(main(sys.argv[1:])) | 550 sys.exit(main(sys.argv[1:])) |
| 554 except KeyboardInterrupt: | 551 except KeyboardInterrupt: |
| 555 buildbot_common.ErrorExit('build_artifacts: interrupted') | 552 buildbot_common.ErrorExit('build_artifacts: interrupted') |
| OLD | NEW |