Chromium Code Reviews| Index: BUILD.gn |
| diff --git a/BUILD.gn b/BUILD.gn |
| index a30f44d66794469dc908fb7b5e1b97b3ede87504..038ef6666b0e25bdca07dfd8933af0b60703fec0 100644 |
| --- a/BUILD.gn |
| +++ b/BUILD.gn |
| @@ -15,9 +15,10 @@ v8_interpreted_regexp = false |
| v8_object_print = false |
| v8_postmortem_support = false |
| v8_use_default_platform = true |
| -#v8_use_snapshot = true |
| +v8_use_snapshot = true |
| v8_enable_extra_checks = is_debug |
| v8_target_arch = cpu_arch |
| +v8_random_seed = "314159265" |
| ############################################################################### |
| @@ -255,6 +256,33 @@ action("postmortem-metadata") { |
| rebase_path(sources, root_build_dir) |
| } |
| +action("run_mksnapshot") { |
| + visibility = ":*" # Only targets in this file can depend on this. |
| + |
| + deps = [ ":mksnapshot($host_toolchain)" ] |
| + |
| + script = "tools/run.py" |
| + |
| + outputs = [ |
| + "$target_gen_dir/snapshot.cc" |
| + ] |
| + |
| + args = [ |
| + "./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)", |
| + "root_out_dir") + "/mksnapshot", |
| + root_build_dir), |
| + "--log-snapshot-positions", |
| + "--logfile", rebase_path("$target_gen_dir/snapshot.log", root_build_dir) |
| + ] |
| + |
| + if (v8_random_seed != "0") { |
| + args += [ "--random-seed", v8_random_seed ] |
| + } |
| + |
| + args += rebase_path(outputs, root_build_dir) |
| +} |
| + |
| + |
| ############################################################################### |
| # Source Sets (aka static libraries) |
| # |
| @@ -281,6 +309,29 @@ source_set("v8_nosnapshot") { |
| configs += [ ":internal_config", ":features", ":toolchain" ] |
| } |
| +source_set("v8_snapshot") { |
| + visibility = ":*" # Only targets in this file can depend on this. |
| + |
| + deps = [ |
| + ":js2c", |
| + ":js2c_experimental", |
| + ":generate_trig_table", |
| + ":run_mksnapshot", |
| + ":v8_base", |
| + ] |
| + |
| + sources = [ |
| + "$target_gen_dir/libraries.cc", |
| + "$target_gen_dir/experimental-libraries.cc", |
| + "$target_gen_dir/trig-table.cc", |
| + "$target_gen_dir/snapshot.cc", |
| + ] |
| + |
| + configs -= [ "//build/config/compiler:chromium_code" ] |
| + configs += [ "//build/config/compiler:no_chromium_code" ] |
| + configs += [ ":internal_config", ":features", ":toolchain" ] |
| +} |
| + |
| source_set("v8_base") { |
| visibility = ":*" # Only targets in this file can depend on this. |
| @@ -905,16 +956,9 @@ source_set("v8_libbase") { |
| # Executables |
| # |
| -if (current_toolchain != host_toolchain && is_android) { |
| - |
| -source_set("mksnapshot") { |
| - sources = [ |
| - ] |
| -} |
| - |
| -} else { |
| - |
| executable("mksnapshot") { |
| + visibility = ":*" # Only targets in this file can depend on this. |
| + |
| sources = [ |
| "src/mksnapshot.cc", |
| ] |
| @@ -933,4 +977,55 @@ executable("mksnapshot") { |
| } |
| } |
| +############################################################################### |
| +# Public targets |
| +# |
| + |
| +if (component_mode == "shared_library") { |
| + |
| +component("v8") { |
|
brettw
2014/05/27 21:26:23
CAn you indent the stuff inside the if?
|
| + sources = [ |
| + "src/v8dll-main.cc", |
| + ] |
| + |
| + if (v8_use_snapshot) { |
| + deps = [ |
| + ":v8_base", |
| + ":v8_snapshot", |
| + ] |
| + } else { |
| + deps = [ |
| + ":v8_base", |
| + ":v8_nosnapshot", |
| + ] |
| + } |
| + |
| + if (is_android && current_toolchain != host_toolchain) { |
| + libs = [ "log" ] |
| + } |
| + |
| + configs -= [ "//build/config/compiler:chromium_code" ] |
| + configs += [ "//build/config/compiler:no_chromium_code" ] |
| + configs += [ ":internal_config", ":features", ":toolchain" ] |
| + |
| + # TODO(jochen): Support direct dependent configs. |
| +} |
| + |
| +} else { |
| + |
| +group("v8") { |
| + if (v8_use_snapshot) { |
| + deps = [ |
| + ":v8_base", |
| + ":v8_snapshot", |
| + ] |
| + } else { |
| + deps = [ |
| + ":v8_base", |
| + ":v8_nosnapshot", |
| + ] |
| + } |
| + # TODO(jochen): Support direct dependent configs. |
| +} |
| + |
| } |