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 # This file isn't officially supported by the Chromium project. It's maintained | 6 # This file isn't officially supported by the Chromium project. It's maintained |
7 # on a best-effort basis by volunteers, so some things may be broken from time | 7 # on a best-effort basis by volunteers, so some things may be broken from time |
8 # to time. If you encounter errors, it's most often due to files in base that | 8 # to time. If you encounter errors, it's most often due to files in base that |
9 # have been added or moved since somebody last tried this script. Generally | 9 # have been added or moved since somebody last tried this script. Generally |
10 # such errors are easy to diagnose. | 10 # such errors are easy to diagnose. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 except subprocess.CalledProcessError as e: | 111 except subprocess.CalledProcessError as e: |
112 print >> sys.stderr, str(e) | 112 print >> sys.stderr, str(e) |
113 return 1 | 113 return 1 |
114 return 0 | 114 return 0 |
115 | 115 |
116 | 116 |
117 def build_gn_with_ninja_manually(tempdir, options): | 117 def build_gn_with_ninja_manually(tempdir, options): |
118 root_gen_dir = os.path.join(tempdir, 'gen') | 118 root_gen_dir = os.path.join(tempdir, 'gen') |
119 mkdir_p(root_gen_dir) | 119 mkdir_p(root_gen_dir) |
120 | 120 |
121 if is_linux: | 121 if is_posix: |
brettw
2016/04/20 17:21:45
Actually I think this file should always be genera
| |
122 mkdir_p(os.path.join(root_gen_dir, 'base', 'allocator')) | 122 mkdir_p(os.path.join(root_gen_dir, 'base', 'allocator')) |
123 with tempfile.NamedTemporaryFile() as f: | 123 with tempfile.NamedTemporaryFile() as f: |
124 f.write('--flags USE_EXPERIMENTAL_ALLOCATOR_SHIM=true') | 124 f.write('--flags USE_EXPERIMENTAL_ALLOCATOR_SHIM=%s' |
125 % ('true' if is_linux else 'false')) | |
125 f.flush() | 126 f.flush() |
126 | 127 |
127 check_call([ | 128 check_call([ |
128 os.path.join(SRC_ROOT, 'build', 'write_buildflag_header.py'), | 129 os.path.join(SRC_ROOT, 'build', 'write_buildflag_header.py'), |
129 '--output', 'base/allocator/features.h', | 130 '--output', 'base/allocator/features.h', |
130 '--gen-dir', root_gen_dir, | 131 '--gen-dir', root_gen_dir, |
131 '--definitions', f.name, | 132 '--definitions', f.name, |
132 ]) | 133 ]) |
133 | 134 |
134 if is_mac: | 135 if is_mac: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 continue | 192 continue |
192 full_path = os.path.join(GN_ROOT, name) | 193 full_path = os.path.join(GN_ROOT, name) |
193 static_libraries['gn']['sources'].append( | 194 static_libraries['gn']['sources'].append( |
194 os.path.relpath(full_path, SRC_ROOT)) | 195 os.path.relpath(full_path, SRC_ROOT)) |
195 | 196 |
196 static_libraries['dynamic_annotations']['sources'].extend([ | 197 static_libraries['dynamic_annotations']['sources'].extend([ |
197 'base/third_party/dynamic_annotations/dynamic_annotations.c', | 198 'base/third_party/dynamic_annotations/dynamic_annotations.c', |
198 'base/third_party/superfasthash/superfasthash.c', | 199 'base/third_party/superfasthash/superfasthash.c', |
199 ]) | 200 ]) |
200 static_libraries['base']['sources'].extend([ | 201 static_libraries['base']['sources'].extend([ |
202 'base/allocator/allocator_check.cc', | |
201 'base/allocator/allocator_extension.cc', | 203 'base/allocator/allocator_extension.cc', |
202 'base/allocator/allocator_shim.cc', | |
203 'base/at_exit.cc', | 204 'base/at_exit.cc', |
204 'base/base_paths.cc', | 205 'base/base_paths.cc', |
205 'base/base_switches.cc', | 206 'base/base_switches.cc', |
206 'base/callback_internal.cc', | 207 'base/callback_internal.cc', |
207 'base/command_line.cc', | 208 'base/command_line.cc', |
208 'base/debug/alias.cc', | 209 'base/debug/alias.cc', |
209 'base/debug/stack_trace.cc', | 210 'base/debug/stack_trace.cc', |
210 'base/debug/task_annotator.cc', | 211 'base/debug/task_annotator.cc', |
211 'base/environment.cc', | 212 'base/environment.cc', |
212 'base/files/file.cc', | 213 'base/files/file.cc', |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
378 libs.extend(['-lrt']) | 379 libs.extend(['-lrt']) |
379 ldflags.extend(['-pthread']) | 380 ldflags.extend(['-pthread']) |
380 | 381 |
381 static_libraries['xdg_user_dirs'] = { | 382 static_libraries['xdg_user_dirs'] = { |
382 'sources': [ | 383 'sources': [ |
383 'base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', | 384 'base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', |
384 ], | 385 ], |
385 'tool': 'cxx', | 386 'tool': 'cxx', |
386 } | 387 } |
387 static_libraries['base']['sources'].extend([ | 388 static_libraries['base']['sources'].extend([ |
389 'base/allocator/allocator_shim.cc', | |
388 'base/allocator/allocator_shim_default_dispatch_to_glibc.cc', | 390 'base/allocator/allocator_shim_default_dispatch_to_glibc.cc', |
389 'base/memory/shared_memory_posix.cc', | 391 'base/memory/shared_memory_posix.cc', |
390 'base/nix/xdg_util.cc', | 392 'base/nix/xdg_util.cc', |
391 'base/process/internal_linux.cc', | 393 'base/process/internal_linux.cc', |
392 'base/process/process_handle_linux.cc', | 394 'base/process/process_handle_linux.cc', |
393 'base/process/process_iterator_linux.cc', | 395 'base/process/process_iterator_linux.cc', |
394 'base/process/process_linux.cc', | 396 'base/process/process_linux.cc', |
395 'base/process/process_metrics_linux.cc', | 397 'base/process/process_metrics_linux.cc', |
396 'base/strings/sys_string_conversions_posix.cc', | 398 'base/strings/sys_string_conversions_posix.cc', |
397 'base/sys_info_linux.cc', | 399 'base/sys_info_linux.cc', |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
512 cmd.append('-v') | 514 cmd.append('-v') |
513 cmd.append('gn') | 515 cmd.append('gn') |
514 check_call(cmd) | 516 check_call(cmd) |
515 | 517 |
516 if not options.debug: | 518 if not options.debug: |
517 check_call(['strip', os.path.join(build_dir, 'gn')]) | 519 check_call(['strip', os.path.join(build_dir, 'gn')]) |
518 | 520 |
519 | 521 |
520 if __name__ == '__main__': | 522 if __name__ == '__main__': |
521 sys.exit(main(sys.argv[1:])) | 523 sys.exit(main(sys.argv[1:])) |
OLD | NEW |