Index: tools/gn/bootstrap/bootstrap.py |
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py |
index 2f5e99597f8dd623a5b7f21d1aee9c7684daf18c..ac8adc86da742815c1ead5f91e06ffa6efaed32a 100755 |
--- a/tools/gn/bootstrap/bootstrap.py |
+++ b/tools/gn/bootstrap/bootstrap.py |
@@ -115,23 +115,40 @@ def main(argv): |
def build_gn_with_ninja_manually(tempdir, options): |
- write_ninja(os.path.join(tempdir, 'build.ninja'), options) |
+ root_gen_dir = os.path.join(tempdir, 'gen') |
+ mkdir_p(root_gen_dir) |
+ |
+ if is_mac: |
tfarina
2016/02/18 22:47:54
Wait, why is this only for Mac? It is not included
NGG
2016/02/18 23:31:48
Because build_time.cc is not compiled for non-mac
brettw
2016/02/19 22:13:48
This seems wrong. Why did you add build_time.cc on
NGG
2016/02/20 14:58:44
It's only needed on Mac because //base/memory/shar
|
+ # //base/build_time.cc needs base/generated_build_date.h, |
+ # and this file is only included for Mac builds. |
+ mkdir_p(os.path.join(root_gen_dir, 'base')) |
+ check_call([ |
+ os.path.join(SRC_ROOT, 'build', 'write_build_date_header.py'), |
+ os.path.join(root_gen_dir, 'base', 'generated_build_date.h'), |
+ 'default' |
+ ]) |
+ |
+ write_ninja(os.path.join(tempdir, 'build.ninja'), root_gen_dir, options) |
cmd = ['ninja', '-C', tempdir] |
if options.verbose: |
cmd.append('-v') |
cmd.append('gn') |
check_call(cmd) |
-def write_ninja(path, options): |
+def write_ninja(path, root_gen_dir, options): |
cc = os.environ.get('CC', '') |
cxx = os.environ.get('CXX', '') |
cflags = os.environ.get('CFLAGS', '').split() |
cflags_cc = os.environ.get('CXXFLAGS', '').split() |
ld = os.environ.get('LD', cxx) |
ldflags = os.environ.get('LDFLAGS', '').split() |
- include_dirs = [SRC_ROOT] |
+ include_dirs = [root_gen_dir, SRC_ROOT] |
libs = [] |
+ # //base/allocator/allocator_extension.cc needs this macro defined, |
+ # otherwise there would be link errors. |
+ cflags.extend(['-DNO_TCMALLOC']) |
+ |
if is_posix: |
if options.debug: |
cflags.extend(['-O0', '-g']) |
@@ -179,6 +196,7 @@ def write_ninja(path, options): |
'base/files/file_path_constants.cc', |
'base/files/file_tracing.cc', |
'base/files/file_util.cc', |
+ 'base/files/memory_mapped_file.cc', |
'base/files/scoped_file.cc', |
'base/hash.cc', |
'base/json/json_parser.cc', |
@@ -202,8 +220,10 @@ def write_ninja(path, options): |
'base/metrics/bucket_ranges.cc', |
'base/metrics/histogram.cc', |
'base/metrics/histogram_base.cc', |
+ 'base/metrics/histogram_persistence.cc', |
'base/metrics/histogram_samples.cc', |
'base/metrics/metrics_hashes.cc', |
+ 'base/metrics/persistent_memory_allocator.cc', |
'base/metrics/sample_map.cc', |
'base/metrics/sample_vector.cc', |
'base/metrics/sparse_histogram.cc', |
@@ -214,6 +234,8 @@ def write_ninja(path, options): |
'base/process/kill.cc', |
'base/process/process_iterator.cc', |
'base/process/process_metrics.cc', |
+ 'base/profiler/scoped_profile.cc', |
+ 'base/profiler/scoped_tracker.cc', |
'base/profiler/tracked_time.cc', |
'base/run_loop.cc', |
'base/sequence_checker_impl.cc', |
@@ -264,7 +286,6 @@ def write_ninja(path, options): |
'base/trace_event/process_memory_dump.cc', |
'base/trace_event/process_memory_maps.cc', |
'base/trace_event/process_memory_totals.cc', |
- 'base/trace_event/process_memory_totals_dump_provider.cc', |
'base/trace_event/trace_buffer.cc', |
'base/trace_event/trace_config.cc', |
'base/trace_event/trace_event_argument.cc', |
@@ -289,6 +310,7 @@ def write_ninja(path, options): |
'base/files/file_enumerator_posix.cc', |
'base/files/file_posix.cc', |
'base/files/file_util_posix.cc', |
+ 'base/files/memory_mapped_file_posix.cc', |
'base/message_loop/message_pump_libevent.cc', |
'base/posix/file_descriptor_shuffle.cc', |
'base/posix/safe_strerror.cc', |
@@ -340,6 +362,7 @@ def write_ninja(path, options): |
'tool': 'cxx', |
} |
static_libraries['base']['sources'].extend([ |
+ 'base/memory/shared_memory_posix.cc', |
'base/nix/xdg_util.cc', |
'base/process/internal_linux.cc', |
'base/process/process_handle_linux.cc', |
@@ -350,7 +373,6 @@ def write_ninja(path, options): |
'base/sys_info_linux.cc', |
'base/threading/platform_thread_linux.cc', |
'base/trace_event/malloc_dump_provider.cc', |
- 'base/trace_event/process_memory_maps_dump_provider.cc', |
]) |
static_libraries['libevent']['include_dirs'].extend([ |
os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'linux') |
@@ -363,6 +385,9 @@ def write_ninja(path, options): |
if is_mac: |
static_libraries['base']['sources'].extend([ |
'base/base_paths_mac.mm', |
+ 'base/build_time.cc', |
+ 'base/rand_util.cc', |
+ 'base/rand_util_posix.cc', |
'base/files/file_util_mac.mm', |
'base/mac/bundle_locations.mm', |
'base/mac/call_with_eh_frame.cc', |
@@ -370,8 +395,12 @@ def write_ninja(path, options): |
'base/mac/foundation_util.mm', |
'base/mac/mach_logging.cc', |
'base/mac/scoped_mach_port.cc', |
+ 'base/mac/scoped_mach_vm.cc', |
'base/mac/scoped_nsautorelease_pool.mm', |
+ 'base/memory/shared_memory_handle_mac.cc', |
+ 'base/memory/shared_memory_mac.cc', |
'base/message_loop/message_pump_mac.mm', |
+ 'base/metrics/field_trial.cc', |
'base/process/process_handle_mac.cc', |
'base/process/process_iterator_mac.cc', |
'base/process/process_metrics_mac.cc', |