OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//testing/test.gni") | 5 import("//testing/test.gni") |
6 import("//v8/gni/v8.gni") | 6 import("//v8/gni/v8.gni") |
7 | 7 |
8 component("gin") { | 8 component("gin") { |
9 sources = [ | 9 sources = [ |
10 "arguments.cc", | 10 "arguments.cc", |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 "//base", | 103 "//base", |
104 "//base:i18n", | 104 "//base:i18n", |
105 "//build/config:exe_and_shlib_deps", | 105 "//build/config:exe_and_shlib_deps", |
106 "//build/win:default_exe_manifest", | 106 "//build/win:default_exe_manifest", |
107 "//v8", | 107 "//v8", |
108 ] | 108 ] |
109 | 109 |
110 configs += [ "//v8:external_startup_data" ] | 110 configs += [ "//v8:external_startup_data" ] |
111 } | 111 } |
112 | 112 |
| 113 group("blink_v8_snapshot") { |
| 114 public_deps = [ |
| 115 ":generate_blink_v8_snapshot", |
| 116 ] |
| 117 } |
| 118 |
| 119 action("generate_blink_v8_snapshot") { |
| 120 script = "run.py" |
| 121 output_file = "$root_out_dir/blink_v8_snapshot.bin" |
| 122 output_path = rebase_path(output_file, root_build_dir) |
| 123 |
| 124 args = [ |
| 125 "./" + rebase_path( |
| 126 get_label_info(":blink_v8_snapshot_generator($host_toolchain)", |
| 127 "root_out_dir") + "/blink_v8_snapshot_generator", |
| 128 root_build_dir), |
| 129 "--output_file=$output_path", |
| 130 ] |
| 131 |
| 132 outputs = [ |
| 133 output_file, |
| 134 ] |
| 135 |
| 136 deps = [ |
| 137 ":blink_v8_snapshot_generator($host_toolchain)", |
| 138 ] |
| 139 } |
| 140 |
| 141 # This config disables a link time optimization "ICF", which may merge different |
| 142 # functions into one if the function signature and body of them are identical. |
| 143 config("disable_icf") { |
| 144 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 145 if (is_clang || use_gold) { |
| 146 ldflags = [ "-Wl,--icf=none" ] |
| 147 } else if (is_win) { |
| 148 # Assume using MSVC linker |
| 149 ldflags = [ "/OPT:NOICF" ] |
| 150 } |
| 151 } |
| 152 |
| 153 executable("blink_v8_snapshot_generator") { |
| 154 sources = [ |
| 155 "shell/blink_v8_snapshot_generator_main.cc", |
| 156 ] |
| 157 |
| 158 deps = [ |
| 159 ":gin", |
| 160 "//mojo/edk/system:system", |
| 161 "//third_party/WebKit/public:blink", |
| 162 "//v8", |
| 163 ] |
| 164 |
| 165 # Link time optimization "ICF" breaks 1:1 mappings of the external references |
| 166 # for V8 snapshot. So, we disable it while taking a V8 snapshot. |
| 167 configs += [ |
| 168 "//v8:external_startup_data", |
| 169 ":disable_icf", |
| 170 ] |
| 171 } |
| 172 |
113 source_set("gin_test") { | 173 source_set("gin_test") { |
114 testonly = true | 174 testonly = true |
115 sources = [ | 175 sources = [ |
116 "test/file.cc", | 176 "test/file.cc", |
117 "test/file.h", | 177 "test/file.h", |
118 "test/file_runner.cc", | 178 "test/file_runner.cc", |
119 "test/file_runner.h", | 179 "test/file_runner.h", |
120 "test/gc.cc", | 180 "test/gc.cc", |
121 "test/gc.h", | 181 "test/gc.h", |
122 "test/gtest.cc", | 182 "test/gtest.cc", |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 "shell/hello_world.js", | 232 "shell/hello_world.js", |
173 "test/file_unittests.js", | 233 "test/file_unittests.js", |
174 "test/gtest_unittests.js", | 234 "test/gtest_unittests.js", |
175 "../OWNERS", | 235 "../OWNERS", |
176 ] | 236 ] |
177 | 237 |
178 data_deps = [ | 238 data_deps = [ |
179 ":gin_shell", | 239 ":gin_shell", |
180 ] | 240 ] |
181 } | 241 } |
OLD | NEW |