Chromium Code Reviews| Index: gin/BUILD.gn |
| diff --git a/gin/BUILD.gn b/gin/BUILD.gn |
| index eaf88a8c77da16cc5e773b3f2dc5dca8ab85157c..dd8aef837d45495a5a6e321f08b0db2310e7ee1f 100644 |
| --- a/gin/BUILD.gn |
| +++ b/gin/BUILD.gn |
| @@ -77,11 +77,11 @@ component("gin") { |
| } |
| defines = [ "GIN_IMPLEMENTATION" ] |
| - |
| public_deps = [ |
| "//base", |
| "//v8", |
| ] |
| + |
| deps = [ |
| "//base/third_party/dynamic_annotations", |
| ] |
| @@ -110,6 +110,65 @@ executable("gin_shell") { |
| configs += [ "//v8:external_startup_data" ] |
| } |
| +group("blink_v8_snapshot") { |
| + public_deps = [ |
| + ":generate_blink_v8_snapshot", |
| + ] |
| +} |
| + |
| +action("generate_blink_v8_snapshot") { |
| + script = "run.py" |
| + output_file = "$root_out_dir/blink_v8_snapshot.bin" |
| + output_path = rebase_path(output_file, root_build_dir) |
| + |
| + args = [ |
| + "./" + rebase_path( |
| + get_label_info(":blink_v8_snapshot_generator($host_toolchain)", |
| + "root_out_dir") + "/blink_v8_snapshot_generator", |
| + root_build_dir), |
| + "--output_file=$output_path", |
| + ] |
| + |
| + outputs = [ |
| + output_file, |
| + ] |
| + |
| + deps = [ |
| + ":blink_v8_snapshot_generator($host_toolchain)", |
| + ] |
| +} |
| + |
| +# This config disables a link time optimization "ICF", which may merge different |
| +# functions into one if the function signatures and body of them are identical. |
|
Yuki
2017/06/20 14:20:10
s/signatures/signature/
peria
2017/06/21 07:19:15
Done.
|
| +config("disable_icf") { |
| + visibility = [ ":*" ] # Only targets in this file can depend on this. |
| + if (is_win) { |
| + ldflags = [ "/OPT:NOICF" ] |
| + } else if (is_posix && !is_mac) { |
|
Yuki
2017/06/20 14:20:10
nit: It would be better to depend on toolchain rat
peria
2017/06/23 02:22:05
Trying...
peria
2017/06/27 09:52:36
ldflags seems to be set depend on platforms, and i
|
| + ldflags = [ "-Wl,--icf=none" ] |
| + } |
| +} |
| + |
| +executable("blink_v8_snapshot_generator") { |
| + sources = [ |
| + "shell/blink_v8_snapshot_generator_main.cc", |
|
Yuki
2017/06/20 14:20:10
This program highly depends on Blink (and it actua
peria
2017/06/23 02:22:05
I think //tools is a place for developer tools, wh
peria
2017/06/27 09:52:36
moved to tools/blink_v8_snapshot
|
| + ] |
| + |
| + deps = [ |
| + ":gin", |
| + "//mojo/edk/system:system", |
| + "//third_party/WebKit/public:blink", |
| + "//v8", |
| + ] |
| + |
| + # Link time optimization "ICF" breaks 1:1 mappings of the external references |
| + # for V8 snapshot. So, we disable it while taking a V8 snapshot. |
| + configs += [ |
| + "//v8:external_startup_data", |
| + ":disable_icf", |
| + ] |
| +} |
| + |
| source_set("gin_test") { |
| testonly = true |
| sources = [ |