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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 cmd.append('gn') | 122 cmd.append('gn') |
123 check_call(cmd) | 123 check_call(cmd) |
124 | 124 |
125 def write_ninja(path, options): | 125 def write_ninja(path, options): |
126 cc = os.environ.get('CC', '') | 126 cc = os.environ.get('CC', '') |
127 cxx = os.environ.get('CXX', '') | 127 cxx = os.environ.get('CXX', '') |
128 cflags = os.environ.get('CFLAGS', '').split() | 128 cflags = os.environ.get('CFLAGS', '').split() |
129 cflags_cc = os.environ.get('CXXFLAGS', '').split() | 129 cflags_cc = os.environ.get('CXXFLAGS', '').split() |
130 ld = os.environ.get('LD', cxx) | 130 ld = os.environ.get('LD', cxx) |
131 ldflags = os.environ.get('LDFLAGS', '').split() | 131 ldflags = os.environ.get('LDFLAGS', '').split() |
132 include_dirs = [SRC_ROOT] | 132 include_dirs = [BOOTSTRAP_DIR, SRC_ROOT] |
133 libs = [] | 133 libs = [] |
134 | 134 |
| 135 cflags.extend(['-DNO_TCMALLOC']) |
| 136 |
135 if is_posix: | 137 if is_posix: |
136 if options.debug: | 138 if options.debug: |
137 cflags.extend(['-O0', '-g']) | 139 cflags.extend(['-O0', '-g']) |
138 else: | 140 else: |
139 cflags.extend(['-O2', '-g0']) | 141 cflags.extend(['-O2', '-g0']) |
140 | 142 |
141 cflags.extend(['-D_FILE_OFFSET_BITS=64', '-pthread', '-pipe']) | 143 cflags.extend(['-D_FILE_OFFSET_BITS=64', '-pthread', '-pipe']) |
142 cflags_cc.extend(['-std=c++11', '-Wno-c++11-narrowing']) | 144 cflags_cc.extend(['-std=c++11', '-Wno-c++11-narrowing']) |
143 | 145 |
144 static_libraries = { | 146 static_libraries = { |
(...skipping 27 matching lines...) Expand all Loading... |
172 'base/debug/alias.cc', | 174 'base/debug/alias.cc', |
173 'base/debug/stack_trace.cc', | 175 'base/debug/stack_trace.cc', |
174 'base/debug/task_annotator.cc', | 176 'base/debug/task_annotator.cc', |
175 'base/environment.cc', | 177 'base/environment.cc', |
176 'base/files/file.cc', | 178 'base/files/file.cc', |
177 'base/files/file_enumerator.cc', | 179 'base/files/file_enumerator.cc', |
178 'base/files/file_path.cc', | 180 'base/files/file_path.cc', |
179 'base/files/file_path_constants.cc', | 181 'base/files/file_path_constants.cc', |
180 'base/files/file_tracing.cc', | 182 'base/files/file_tracing.cc', |
181 'base/files/file_util.cc', | 183 'base/files/file_util.cc', |
| 184 'base/files/memory_mapped_file.cc', |
182 'base/files/scoped_file.cc', | 185 'base/files/scoped_file.cc', |
183 'base/hash.cc', | 186 'base/hash.cc', |
184 'base/json/json_parser.cc', | 187 'base/json/json_parser.cc', |
185 'base/json/json_reader.cc', | 188 'base/json/json_reader.cc', |
186 'base/json/json_string_value_serializer.cc', | 189 'base/json/json_string_value_serializer.cc', |
187 'base/json/json_writer.cc', | 190 'base/json/json_writer.cc', |
188 'base/json/string_escape.cc', | 191 'base/json/string_escape.cc', |
189 'base/lazy_instance.cc', | 192 'base/lazy_instance.cc', |
190 'base/location.cc', | 193 'base/location.cc', |
191 'base/logging.cc', | 194 'base/logging.cc', |
192 'base/md5.cc', | 195 'base/md5.cc', |
193 'base/memory/ref_counted.cc', | 196 'base/memory/ref_counted.cc', |
194 'base/memory/ref_counted_memory.cc', | 197 'base/memory/ref_counted_memory.cc', |
195 'base/memory/singleton.cc', | 198 'base/memory/singleton.cc', |
196 'base/memory/weak_ptr.cc', | 199 'base/memory/weak_ptr.cc', |
197 'base/message_loop/incoming_task_queue.cc', | 200 'base/message_loop/incoming_task_queue.cc', |
198 'base/message_loop/message_loop.cc', | 201 'base/message_loop/message_loop.cc', |
199 'base/message_loop/message_loop_task_runner.cc', | 202 'base/message_loop/message_loop_task_runner.cc', |
200 'base/message_loop/message_pump.cc', | 203 'base/message_loop/message_pump.cc', |
201 'base/message_loop/message_pump_default.cc', | 204 'base/message_loop/message_pump_default.cc', |
202 'base/metrics/bucket_ranges.cc', | 205 'base/metrics/bucket_ranges.cc', |
203 'base/metrics/histogram.cc', | 206 'base/metrics/histogram.cc', |
204 'base/metrics/histogram_base.cc', | 207 'base/metrics/histogram_base.cc', |
| 208 'base/metrics/histogram_persistence.cc', |
205 'base/metrics/histogram_samples.cc', | 209 'base/metrics/histogram_samples.cc', |
206 'base/metrics/metrics_hashes.cc', | 210 'base/metrics/metrics_hashes.cc', |
| 211 'base/metrics/persistent_memory_allocator.cc', |
207 'base/metrics/sample_map.cc', | 212 'base/metrics/sample_map.cc', |
208 'base/metrics/sample_vector.cc', | 213 'base/metrics/sample_vector.cc', |
209 'base/metrics/sparse_histogram.cc', | 214 'base/metrics/sparse_histogram.cc', |
210 'base/metrics/statistics_recorder.cc', | 215 'base/metrics/statistics_recorder.cc', |
211 'base/path_service.cc', | 216 'base/path_service.cc', |
212 'base/pending_task.cc', | 217 'base/pending_task.cc', |
213 'base/pickle.cc', | 218 'base/pickle.cc', |
214 'base/process/kill.cc', | 219 'base/process/kill.cc', |
215 'base/process/process_iterator.cc', | 220 'base/process/process_iterator.cc', |
216 'base/process/process_metrics.cc', | 221 'base/process/process_metrics.cc', |
| 222 'base/profiler/scoped_profile.cc', |
| 223 'base/profiler/scoped_tracker.cc', |
217 'base/profiler/tracked_time.cc', | 224 'base/profiler/tracked_time.cc', |
218 'base/run_loop.cc', | 225 'base/run_loop.cc', |
219 'base/sequence_checker_impl.cc', | 226 'base/sequence_checker_impl.cc', |
220 'base/sequenced_task_runner.cc', | 227 'base/sequenced_task_runner.cc', |
221 'base/sha1_portable.cc', | 228 'base/sha1_portable.cc', |
222 'base/strings/pattern.cc', | 229 'base/strings/pattern.cc', |
223 'base/strings/string16.cc', | 230 'base/strings/string16.cc', |
224 'base/strings/string_number_conversions.cc', | 231 'base/strings/string_number_conversions.cc', |
225 'base/strings/string_piece.cc', | 232 'base/strings/string_piece.cc', |
226 'base/strings/string_split.cc', | 233 'base/strings/string_split.cc', |
(...skipping 30 matching lines...) Expand all Loading... |
257 'base/trace_event/heap_profiler_stack_frame_deduplicator.cc', | 264 'base/trace_event/heap_profiler_stack_frame_deduplicator.cc', |
258 'base/trace_event/heap_profiler_type_name_deduplicator.cc', | 265 'base/trace_event/heap_profiler_type_name_deduplicator.cc', |
259 'base/trace_event/memory_allocator_dump.cc', | 266 'base/trace_event/memory_allocator_dump.cc', |
260 'base/trace_event/memory_allocator_dump_guid.cc', | 267 'base/trace_event/memory_allocator_dump_guid.cc', |
261 'base/trace_event/memory_dump_manager.cc', | 268 'base/trace_event/memory_dump_manager.cc', |
262 'base/trace_event/memory_dump_request_args.cc', | 269 'base/trace_event/memory_dump_request_args.cc', |
263 'base/trace_event/memory_dump_session_state.cc', | 270 'base/trace_event/memory_dump_session_state.cc', |
264 'base/trace_event/process_memory_dump.cc', | 271 'base/trace_event/process_memory_dump.cc', |
265 'base/trace_event/process_memory_maps.cc', | 272 'base/trace_event/process_memory_maps.cc', |
266 'base/trace_event/process_memory_totals.cc', | 273 'base/trace_event/process_memory_totals.cc', |
267 'base/trace_event/process_memory_totals_dump_provider.cc', | |
268 'base/trace_event/trace_buffer.cc', | 274 'base/trace_event/trace_buffer.cc', |
269 'base/trace_event/trace_config.cc', | 275 'base/trace_event/trace_config.cc', |
270 'base/trace_event/trace_event_argument.cc', | 276 'base/trace_event/trace_event_argument.cc', |
271 'base/trace_event/trace_event_impl.cc', | 277 'base/trace_event/trace_event_impl.cc', |
272 'base/trace_event/trace_event_memory_overhead.cc', | 278 'base/trace_event/trace_event_memory_overhead.cc', |
273 'base/trace_event/trace_event_synthetic_delay.cc', | 279 'base/trace_event/trace_event_synthetic_delay.cc', |
274 'base/trace_event/trace_log.cc', | 280 'base/trace_event/trace_log.cc', |
275 'base/trace_event/trace_log_constants.cc', | 281 'base/trace_event/trace_log_constants.cc', |
276 'base/trace_event/trace_sampling_thread.cc', | 282 'base/trace_event/trace_sampling_thread.cc', |
277 'base/trace_event/tracing_agent.cc', | 283 'base/trace_event/tracing_agent.cc', |
278 'base/tracked_objects.cc', | 284 'base/tracked_objects.cc', |
279 'base/tracking_info.cc', | 285 'base/tracking_info.cc', |
280 'base/values.cc', | 286 'base/values.cc', |
281 'base/vlog.cc', | 287 'base/vlog.cc', |
282 ]) | 288 ]) |
283 | 289 |
284 if is_posix: | 290 if is_posix: |
285 static_libraries['base']['sources'].extend([ | 291 static_libraries['base']['sources'].extend([ |
286 'base/base_paths_posix.cc', | 292 'base/base_paths_posix.cc', |
287 'base/debug/debugger_posix.cc', | 293 'base/debug/debugger_posix.cc', |
288 'base/debug/stack_trace_posix.cc', | 294 'base/debug/stack_trace_posix.cc', |
289 'base/files/file_enumerator_posix.cc', | 295 'base/files/file_enumerator_posix.cc', |
290 'base/files/file_posix.cc', | 296 'base/files/file_posix.cc', |
291 'base/files/file_util_posix.cc', | 297 'base/files/file_util_posix.cc', |
| 298 'base/files/memory_mapped_file_posix.cc', |
292 'base/message_loop/message_pump_libevent.cc', | 299 'base/message_loop/message_pump_libevent.cc', |
293 'base/posix/file_descriptor_shuffle.cc', | 300 'base/posix/file_descriptor_shuffle.cc', |
294 'base/posix/safe_strerror.cc', | 301 'base/posix/safe_strerror.cc', |
295 'base/process/kill_posix.cc', | 302 'base/process/kill_posix.cc', |
296 'base/process/process_handle_posix.cc', | 303 'base/process/process_handle_posix.cc', |
297 'base/process/process_metrics_posix.cc', | 304 'base/process/process_metrics_posix.cc', |
298 'base/process/process_posix.cc', | 305 'base/process/process_posix.cc', |
299 'base/synchronization/condition_variable_posix.cc', | 306 'base/synchronization/condition_variable_posix.cc', |
300 'base/synchronization/lock_impl_posix.cc', | 307 'base/synchronization/lock_impl_posix.cc', |
301 'base/synchronization/waitable_event_posix.cc', | 308 'base/synchronization/waitable_event_posix.cc', |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 libs.extend(['-lrt']) | 340 libs.extend(['-lrt']) |
334 ldflags.extend(['-pthread']) | 341 ldflags.extend(['-pthread']) |
335 | 342 |
336 static_libraries['xdg_user_dirs'] = { | 343 static_libraries['xdg_user_dirs'] = { |
337 'sources': [ | 344 'sources': [ |
338 'base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', | 345 'base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', |
339 ], | 346 ], |
340 'tool': 'cxx', | 347 'tool': 'cxx', |
341 } | 348 } |
342 static_libraries['base']['sources'].extend([ | 349 static_libraries['base']['sources'].extend([ |
| 350 'base/memory/shared_memory_posix.cc', |
343 'base/nix/xdg_util.cc', | 351 'base/nix/xdg_util.cc', |
344 'base/process/internal_linux.cc', | 352 'base/process/internal_linux.cc', |
345 'base/process/process_handle_linux.cc', | 353 'base/process/process_handle_linux.cc', |
346 'base/process/process_iterator_linux.cc', | 354 'base/process/process_iterator_linux.cc', |
347 'base/process/process_linux.cc', | 355 'base/process/process_linux.cc', |
348 'base/process/process_metrics_linux.cc', | 356 'base/process/process_metrics_linux.cc', |
349 'base/strings/sys_string_conversions_posix.cc', | 357 'base/strings/sys_string_conversions_posix.cc', |
350 'base/sys_info_linux.cc', | 358 'base/sys_info_linux.cc', |
351 'base/threading/platform_thread_linux.cc', | 359 'base/threading/platform_thread_linux.cc', |
352 'base/trace_event/malloc_dump_provider.cc', | 360 'base/trace_event/malloc_dump_provider.cc', |
353 'base/trace_event/process_memory_maps_dump_provider.cc', | |
354 ]) | 361 ]) |
355 static_libraries['libevent']['include_dirs'].extend([ | 362 static_libraries['libevent']['include_dirs'].extend([ |
356 os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'linux') | 363 os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'linux') |
357 ]) | 364 ]) |
358 static_libraries['libevent']['sources'].extend([ | 365 static_libraries['libevent']['sources'].extend([ |
359 'base/third_party/libevent/epoll.c', | 366 'base/third_party/libevent/epoll.c', |
360 ]) | 367 ]) |
361 | 368 |
362 | 369 |
363 if is_mac: | 370 if is_mac: |
364 static_libraries['base']['sources'].extend([ | 371 static_libraries['base']['sources'].extend([ |
365 'base/base_paths_mac.mm', | 372 'base/base_paths_mac.mm', |
| 373 'base/build_time.cc', |
| 374 'base/rand_util.cc', |
| 375 'base/rand_util_posix.cc', |
366 'base/files/file_util_mac.mm', | 376 'base/files/file_util_mac.mm', |
367 'base/mac/bundle_locations.mm', | 377 'base/mac/bundle_locations.mm', |
368 'base/mac/call_with_eh_frame.cc', | 378 'base/mac/call_with_eh_frame.cc', |
369 'base/mac/call_with_eh_frame_asm.S', | 379 'base/mac/call_with_eh_frame_asm.S', |
370 'base/mac/foundation_util.mm', | 380 'base/mac/foundation_util.mm', |
371 'base/mac/mach_logging.cc', | 381 'base/mac/mach_logging.cc', |
372 'base/mac/scoped_mach_port.cc', | 382 'base/mac/scoped_mach_port.cc', |
| 383 'base/mac/scoped_mach_vm.cc', |
373 'base/mac/scoped_nsautorelease_pool.mm', | 384 'base/mac/scoped_nsautorelease_pool.mm', |
| 385 'base/memory/shared_memory_handle_mac.cc', |
| 386 'base/memory/shared_memory_mac.cc', |
374 'base/message_loop/message_pump_mac.mm', | 387 'base/message_loop/message_pump_mac.mm', |
| 388 'base/metrics/field_trial.cc', |
375 'base/process/process_handle_mac.cc', | 389 'base/process/process_handle_mac.cc', |
376 'base/process/process_iterator_mac.cc', | 390 'base/process/process_iterator_mac.cc', |
377 'base/process/process_metrics_mac.cc', | 391 'base/process/process_metrics_mac.cc', |
378 'base/strings/sys_string_conversions_mac.mm', | 392 'base/strings/sys_string_conversions_mac.mm', |
379 'base/time/time_mac.cc', | 393 'base/time/time_mac.cc', |
380 'base/threading/platform_thread_mac.mm', | 394 'base/threading/platform_thread_mac.mm', |
381 'base/trace_event/malloc_dump_provider.cc', | 395 'base/trace_event/malloc_dump_provider.cc', |
382 ]) | 396 ]) |
383 static_libraries['libevent']['include_dirs'].extend([ | 397 static_libraries['libevent']['include_dirs'].extend([ |
384 os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'mac') | 398 os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'mac') |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 cmd.append('-v') | 473 cmd.append('-v') |
460 cmd.append('gn') | 474 cmd.append('gn') |
461 check_call(cmd) | 475 check_call(cmd) |
462 | 476 |
463 if not options.debug: | 477 if not options.debug: |
464 check_call(['strip', os.path.join(build_dir, 'gn')]) | 478 check_call(['strip', os.path.join(build_dir, 'gn')]) |
465 | 479 |
466 | 480 |
467 if __name__ == '__main__': | 481 if __name__ == '__main__': |
468 sys.exit(main(sys.argv[1:])) | 482 sys.exit(main(sys.argv[1:])) |
OLD | NEW |