OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 3 # Copyright (c) 2014 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if not os.environ.get('GYP_GENERATORS'): | 79 if not os.environ.get('GYP_GENERATORS'): |
80 os.environ['GYP_GENERATORS'] = 'ninja' | 80 os.environ['GYP_GENERATORS'] = 'ninja' |
81 | 81 |
82 # Enable check for missing sources in GYP files on Windows. | 82 # Enable check for missing sources in GYP files on Windows. |
83 if sys.platform.startswith('win'): | 83 if sys.platform.startswith('win'): |
84 gyp_generator_flags = os.getenv('GYP_GENERATOR_FLAGS', '') | 84 gyp_generator_flags = os.getenv('GYP_GENERATOR_FLAGS', '') |
85 if not 'msvs_error_on_missing_sources' in gyp_generator_flags: | 85 if not 'msvs_error_on_missing_sources' in gyp_generator_flags: |
86 os.environ['GYP_GENERATOR_FLAGS'] = ( | 86 os.environ['GYP_GENERATOR_FLAGS'] = ( |
87 gyp_generator_flags + ' msvs_error_on_missing_sources=1') | 87 gyp_generator_flags + ' msvs_error_on_missing_sources=1') |
88 | 88 |
89 vs2013_runtime_dll_dirs = None, None | 89 vs2013_runtime_dll_dirs = None |
90 if int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1')): | 90 if int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1')): |
91 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() | 91 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() |
92 | 92 |
93 # Enforce gyp syntax checking. This adds about 20% execution time. | 93 # Enforce gyp syntax checking. This adds about 20% execution time. |
94 args.append('--check') | 94 args.append('--check') |
95 | 95 |
96 supplemental_includes = GetSupplementalFiles() | 96 supplemental_includes = GetSupplementalFiles() |
97 gyp_vars = gyp_chromium.GetGypVars(supplemental_includes) | 97 gyp_vars = gyp_chromium.GetGypVars(supplemental_includes) |
98 | 98 |
99 # Automatically turn on crosscompile support for platforms that need it. | 99 # Automatically turn on crosscompile support for platforms that need it. |
100 if all(('ninja' in os.environ.get('GYP_GENERATORS', ''), | 100 if all(('ninja' in os.environ.get('GYP_GENERATORS', ''), |
101 gyp_vars.get('OS') in ['android', 'ios'], | 101 gyp_vars.get('OS') in ['android', 'ios'], |
102 'GYP_CROSSCOMPILE' not in os.environ)): | 102 'GYP_CROSSCOMPILE' not in os.environ)): |
103 os.environ['GYP_CROSSCOMPILE'] = '1' | 103 os.environ['GYP_CROSSCOMPILE'] = '1' |
104 | 104 |
105 args.extend(['-I' + i for i in | 105 args.extend(['-I' + i for i in |
106 gyp_chromium.additional_include_files(supplemental_includes, | 106 gyp_chromium.additional_include_files(supplemental_includes, |
107 args)]) | 107 args)]) |
108 | 108 |
109 # Set the gyp depth variable to the root of the checkout. | 109 # Set the gyp depth variable to the root of the checkout. |
110 args.append('--depth=' + os.path.relpath(checkout_root)) | 110 args.append('--depth=' + os.path.relpath(checkout_root)) |
111 | 111 |
112 print 'Updating projects from gyp files...' | 112 print 'Updating projects from gyp files...' |
113 sys.stdout.flush() | 113 sys.stdout.flush() |
114 | 114 |
115 # Off we go... | 115 # Off we go... |
116 gyp_rc = gyp.main(args) | 116 gyp_rc = gyp.main(args) |
117 | 117 |
118 if vs2013_runtime_dll_dirs: | 118 if vs2013_runtime_dll_dirs: |
| 119 # pylint: disable=unpacking-non-sequence |
119 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | 120 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
120 vs_toolchain.CopyVsRuntimeDlls( | 121 vs_toolchain.CopyVsRuntimeDlls( |
121 os.path.join(checkout_root, gyp_chromium.GetOutputDirectory()), | 122 os.path.join(checkout_root, gyp_chromium.GetOutputDirectory()), |
122 (x86_runtime, x64_runtime)) | 123 (x86_runtime, x64_runtime)) |
123 | 124 |
124 sys.exit(gyp_rc) | 125 sys.exit(gyp_rc) |
125 | 126 |
126 | 127 |
127 if __name__ == '__main__': | 128 if __name__ == '__main__': |
128 sys.exit(main()) | 129 sys.exit(main()) |
129 | 130 |
OLD | NEW |