Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: tools/gn/bootstrap/bootstrap.py

Issue 1895413005: GN: Fix bootstrap.py on mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: create features.h on all platforms Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 mkdir_p(os.path.join(root_gen_dir, 'base', 'allocator'))
122 mkdir_p(os.path.join(root_gen_dir, 'base', 'allocator')) 122 with tempfile.NamedTemporaryFile() as f:
123 with tempfile.NamedTemporaryFile() as f: 123 f.write('--flags USE_EXPERIMENTAL_ALLOCATOR_SHIM=%s'
124 f.write('--flags USE_EXPERIMENTAL_ALLOCATOR_SHIM=true') 124 % ('true' if is_linux else 'false'))
125 f.flush() 125 f.flush()
126 126
127 check_call([ 127 check_call([
128 os.path.join(SRC_ROOT, 'build', 'write_buildflag_header.py'), 128 os.path.join(SRC_ROOT, 'build', 'write_buildflag_header.py'),
129 '--output', 'base/allocator/features.h', 129 '--output', 'base/allocator/features.h',
130 '--gen-dir', root_gen_dir, 130 '--gen-dir', root_gen_dir,
131 '--definitions', f.name, 131 '--definitions', f.name,
132 ]) 132 ])
133 133
134 if is_mac: 134 if is_mac:
135 # //base/build_time.cc needs base/generated_build_date.h, 135 # //base/build_time.cc needs base/generated_build_date.h,
136 # and this file is only included for Mac builds. 136 # and this file is only included for Mac builds.
137 mkdir_p(os.path.join(root_gen_dir, 'base')) 137 mkdir_p(os.path.join(root_gen_dir, 'base'))
138 check_call([ 138 check_call([
139 os.path.join(SRC_ROOT, 'build', 'write_build_date_header.py'), 139 os.path.join(SRC_ROOT, 'build', 'write_build_date_header.py'),
140 os.path.join(root_gen_dir, 'base', 'generated_build_date.h'), 140 os.path.join(root_gen_dir, 'base', 'generated_build_date.h'),
141 'default' 141 'default'
142 ]) 142 ])
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 continue 191 continue
192 full_path = os.path.join(GN_ROOT, name) 192 full_path = os.path.join(GN_ROOT, name)
193 static_libraries['gn']['sources'].append( 193 static_libraries['gn']['sources'].append(
194 os.path.relpath(full_path, SRC_ROOT)) 194 os.path.relpath(full_path, SRC_ROOT))
195 195
196 static_libraries['dynamic_annotations']['sources'].extend([ 196 static_libraries['dynamic_annotations']['sources'].extend([
197 'base/third_party/dynamic_annotations/dynamic_annotations.c', 197 'base/third_party/dynamic_annotations/dynamic_annotations.c',
198 'base/third_party/superfasthash/superfasthash.c', 198 'base/third_party/superfasthash/superfasthash.c',
199 ]) 199 ])
200 static_libraries['base']['sources'].extend([ 200 static_libraries['base']['sources'].extend([
201 'base/allocator/allocator_check.cc',
201 'base/allocator/allocator_extension.cc', 202 'base/allocator/allocator_extension.cc',
202 'base/allocator/allocator_shim.cc',
203 'base/at_exit.cc', 203 'base/at_exit.cc',
204 'base/base_paths.cc', 204 'base/base_paths.cc',
205 'base/base_switches.cc', 205 'base/base_switches.cc',
206 'base/callback_internal.cc', 206 'base/callback_internal.cc',
207 'base/command_line.cc', 207 'base/command_line.cc',
208 'base/debug/alias.cc', 208 'base/debug/alias.cc',
209 'base/debug/stack_trace.cc', 209 'base/debug/stack_trace.cc',
210 'base/debug/task_annotator.cc', 210 'base/debug/task_annotator.cc',
211 'base/environment.cc', 211 'base/environment.cc',
212 'base/files/file.cc', 212 'base/files/file.cc',
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 libs.extend(['-lrt']) 378 libs.extend(['-lrt'])
379 ldflags.extend(['-pthread']) 379 ldflags.extend(['-pthread'])
380 380
381 static_libraries['xdg_user_dirs'] = { 381 static_libraries['xdg_user_dirs'] = {
382 'sources': [ 382 'sources': [
383 'base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', 383 'base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
384 ], 384 ],
385 'tool': 'cxx', 385 'tool': 'cxx',
386 } 386 }
387 static_libraries['base']['sources'].extend([ 387 static_libraries['base']['sources'].extend([
388 'base/allocator/allocator_shim.cc',
388 'base/allocator/allocator_shim_default_dispatch_to_glibc.cc', 389 'base/allocator/allocator_shim_default_dispatch_to_glibc.cc',
389 'base/memory/shared_memory_posix.cc', 390 'base/memory/shared_memory_posix.cc',
390 'base/nix/xdg_util.cc', 391 'base/nix/xdg_util.cc',
391 'base/process/internal_linux.cc', 392 'base/process/internal_linux.cc',
392 'base/process/process_handle_linux.cc', 393 'base/process/process_handle_linux.cc',
393 'base/process/process_iterator_linux.cc', 394 'base/process/process_iterator_linux.cc',
394 'base/process/process_linux.cc', 395 'base/process/process_linux.cc',
395 'base/process/process_metrics_linux.cc', 396 'base/process/process_metrics_linux.cc',
396 'base/strings/sys_string_conversions_posix.cc', 397 'base/strings/sys_string_conversions_posix.cc',
397 'base/sys_info_linux.cc', 398 'base/sys_info_linux.cc',
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 cmd.append('-v') 513 cmd.append('-v')
513 cmd.append('gn') 514 cmd.append('gn')
514 check_call(cmd) 515 check_call(cmd)
515 516
516 if not options.debug: 517 if not options.debug:
517 check_call(['strip', os.path.join(build_dir, 'gn')]) 518 check_call(['strip', os.path.join(build_dir, 'gn')])
518 519
519 520
520 if __name__ == '__main__': 521 if __name__ == '__main__':
521 sys.exit(main(sys.argv[1:])) 522 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698