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

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

Issue 1411303008: GN bootstrap fixes: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 """Bootstraps gn. 6 """Bootstraps gn.
7 7
8 It is done by first building it manually in a temporary directory, then building 8 It is done by first building it manually in a temporary directory, then building
9 it with its own BUILD.gn to the final destination. 9 it with its own BUILD.gn to the final destination.
10 """ 10 """
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 print 'Building gn manually in a temporary directory for bootstrapping...' 58 print 'Building gn manually in a temporary directory for bootstrapping...'
59 build_gn_with_ninja_manually(tempdir, options) 59 build_gn_with_ninja_manually(tempdir, options)
60 temp_gn = os.path.join(tempdir, 'gn') 60 temp_gn = os.path.join(tempdir, 'gn')
61 out_gn = os.path.join(build_root, 'gn') 61 out_gn = os.path.join(build_root, 'gn')
62 62
63 if options.no_rebuild: 63 if options.no_rebuild:
64 mkdir_p(build_root) 64 mkdir_p(build_root)
65 shutil.copy2(temp_gn, out_gn) 65 shutil.copy2(temp_gn, out_gn)
66 else: 66 else:
67 print 'Building gn using itself to %s...' % build_rel 67 print 'Building gn using itself to %s...' % build_rel
68 build_gn_with_gn(temp_gn, build_rel, options) 68 build_gn_with_gn(temp_gn, build_root, options)
69 69
70 if options.output: 70 if options.output:
71 # Preserve the executable permission bit. 71 # Preserve the executable permission bit.
72 shutil.copy2(out_gn, options.output) 72 shutil.copy2(out_gn, options.output)
73 73
74 74
75 def main(argv): 75 def main(argv):
76 parser = optparse.OptionParser(description=sys.modules[__name__].__doc__) 76 parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
77 parser.add_option('-d', '--debug', action='store_true', 77 parser.add_option('-d', '--debug', action='store_true',
78 help='Do a debug build. Defaults to release build.') 78 help='Do a debug build. Defaults to release build.')
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 continue 149 continue
150 full_path = os.path.join(GN_ROOT, name) 150 full_path = os.path.join(GN_ROOT, name)
151 static_libraries['gn']['sources'].append( 151 static_libraries['gn']['sources'].append(
152 os.path.relpath(full_path, SRC_ROOT)) 152 os.path.relpath(full_path, SRC_ROOT))
153 153
154 static_libraries['dynamic_annotations']['sources'].extend([ 154 static_libraries['dynamic_annotations']['sources'].extend([
155 'base/third_party/dynamic_annotations/dynamic_annotations.c', 155 'base/third_party/dynamic_annotations/dynamic_annotations.c',
156 'base/third_party/superfasthash/superfasthash.c', 156 'base/third_party/superfasthash/superfasthash.c',
157 ]) 157 ])
158 static_libraries['base']['sources'].extend([ 158 static_libraries['base']['sources'].extend([
159 'base/allocator/allocator_extension_thunks.cc',
159 'base/at_exit.cc', 160 'base/at_exit.cc',
160 'base/base_paths.cc', 161 'base/base_paths.cc',
161 'base/base_switches.cc', 162 'base/base_switches.cc',
162 'base/callback_internal.cc', 163 'base/callback_internal.cc',
163 'base/command_line.cc', 164 'base/command_line.cc',
164 'base/debug/alias.cc', 165 'base/debug/alias.cc',
165 'base/debug/stack_trace.cc', 166 'base/debug/stack_trace.cc',
166 'base/debug/task_annotator.cc', 167 'base/debug/task_annotator.cc',
167 'base/environment.cc', 168 'base/environment.cc',
168 'base/files/file.cc', 169 'base/files/file.cc',
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 cmd.append('-v') 445 cmd.append('-v')
445 cmd.append('gn') 446 cmd.append('gn')
446 check_call(cmd) 447 check_call(cmd)
447 448
448 if not options.debug: 449 if not options.debug:
449 check_call(['strip', os.path.join(build_dir, 'gn')]) 450 check_call(['strip', os.path.join(build_dir, 'gn')])
450 451
451 452
452 if __name__ == '__main__': 453 if __name__ == '__main__':
453 sys.exit(main(sys.argv[1:])) 454 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