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 """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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 include_dirs = [SRC_ROOT] | 125 include_dirs = [SRC_ROOT] |
126 libs = [] | 126 libs = [] |
127 | 127 |
128 if is_posix: | 128 if is_posix: |
129 if options.debug: | 129 if options.debug: |
130 cflags.extend(['-O0', '-g']) | 130 cflags.extend(['-O0', '-g']) |
131 else: | 131 else: |
132 cflags.extend(['-O2', '-g0']) | 132 cflags.extend(['-O2', '-g0']) |
133 | 133 |
134 cflags.extend(['-D_FILE_OFFSET_BITS=64', '-pthread', '-pipe']) | 134 cflags.extend(['-D_FILE_OFFSET_BITS=64', '-pthread', '-pipe']) |
135 cflags_cc.extend(['-std=gnu++11', '-Wno-c++11-narrowing']) | 135 cflags_cc.extend(['-std=c++11', '-Wno-c++11-narrowing']) |
136 | 136 |
137 static_libraries = { | 137 static_libraries = { |
138 'base': {'sources': [], 'tool': 'cxx'}, | 138 'base': {'sources': [], 'tool': 'cxx'}, |
139 'dynamic_annotations': {'sources': [], 'tool': 'cc'}, | 139 'dynamic_annotations': {'sources': [], 'tool': 'cc'}, |
140 'gn': {'sources': [], 'tool': 'cxx'}, | 140 'gn': {'sources': [], 'tool': 'cxx'}, |
141 } | 141 } |
142 | 142 |
143 for name in os.listdir(GN_ROOT): | 143 for name in os.listdir(GN_ROOT): |
144 if not name.endswith('.cc'): | 144 if not name.endswith('.cc'): |
145 continue | 145 continue |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 cmd.append('-v') | 443 cmd.append('-v') |
444 cmd.append('gn') | 444 cmd.append('gn') |
445 check_call(cmd) | 445 check_call(cmd) |
446 | 446 |
447 if not options.debug: | 447 if not options.debug: |
448 check_call(['strip', os.path.join(build_dir, 'gn')]) | 448 check_call(['strip', os.path.join(build_dir, 'gn')]) |
449 | 449 |
450 | 450 |
451 if __name__ == '__main__': | 451 if __name__ == '__main__': |
452 sys.exit(main(sys.argv[1:])) | 452 sys.exit(main(sys.argv[1:])) |
OLD | NEW |