1 # Copyright 2014 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 import("//build/config/android/rules.gni")
8 import("//base/allocator/partition_allocator/partition_alloc.gni")
9 import("//testing/test.gni")
10 import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
11 import("//v8/gni/v8.gni")
23 "data_object_builder.cc",
24 "data_object_builder.h",
29 "function_template.cc",
30 "function_template.h",
40 "object_template_builder.cc",
41 "object_template_builder.h",
42 "per_context_data.cc",
44 "per_isolate_data.cc",
46 "public/context_holder.h",
49 "public/gin_embedders.h",
50 "public/isolate_holder.h",
51 "public/v8_idle_task_runner.h",
52 "public/v8_platform.h",
53 "public/wrapper_info.h",
58 "thread_isolation.cc",
64 "v8_foreground_task_runner.cc",
65 "v8_foreground_task_runner.h",
66 "v8_foreground_task_runner_base.cc",
67 "v8_foreground_task_runner_base.h",
68 "v8_foreground_task_runner_with_locker.cc",
69 "v8_foreground_task_runner_with_locker.h",
72 "v8_isolate_memory_dump_provider.cc",
73 "v8_isolate_memory_dump_provider.h",
75 "v8_shared_memory_dump_provider.cc",
76 "v8_shared_memory_dump_provider.h",
82 if (use_partition_alloc) {
84 "v8_platform_page_allocator.cc",
85 "v8_platform_page_allocator.h",
89 "v8_platform_thread_isolated_allocator.cc",
90 "v8_platform_thread_isolated_allocator.h",
95 if (v8_use_external_startup_data) {
96 data = [ "$root_out_dir/snapshot_blob.bin" ]
97 sources += [ "public/v8_snapshot_file_type.h" ]
100 defines = [ "GIN_IMPLEMENTATION" ]
104 "//base/allocator:buildflags",
108 "//base/third_party/dynamic_annotations",
109 "//third_party/abseil-cpp:absl",
110 "//tools/v8_context_snapshot:buildflags",
114 frameworks = [ "CoreFoundation.framework" ]
117 configs += [ "//v8:external_startup_data" ]
120 executable("gin_shell") {
121 sources = [ "shell/gin_main.cc" ]
127 "//build/win:default_exe_manifest",
131 configs += [ "//v8:external_startup_data" ]
134 if (is_android && enable_java_templates &&
135 current_toolchain == default_toolchain) {
136 android_assets("v8_snapshot_assets") {
137 if (v8_use_external_startup_data) {
138 disable_compression = true
139 if (use_v8_context_snapshot) {
140 deps = [ "//tools/v8_context_snapshot:v8_context_snapshot" ]
141 sources = [ "$root_build_dir/$v8_context_snapshot_filename" ]
143 if (current_cpu == "arm" || current_cpu == "x86") {
148 renaming_sources = [ "$root_build_dir/snapshot_blob.bin" ]
149 renaming_destinations = [ "snapshot_blob_$_arch_suffix.bin" ]
150 deps = [ "//v8:run_mksnapshot_default" ]
155 if (android_64bit_target_cpu && !skip_secondary_abi_for_cq) {
156 android_assets("v8_snapshot_secondary_abi_assets") {
157 assert(android_64bit_target_cpu,
158 "32-bit targets shouldn't have secondary abi")
159 disable_compression = true
160 if (use_v8_context_snapshot) {
161 sources = [ "$root_out_dir/v8_context_snapshot_32.bin" ]
163 [ "//tools/v8_context_snapshot($android_secondary_abi_toolchain)" ]
165 _secondary_abi_out_dir =
166 get_label_info("//v8($android_secondary_abi_toolchain)",
168 renaming_sources = [ "$_secondary_abi_out_dir/snapshot_blob.bin" ]
169 renaming_destinations = [ "snapshot_blob_32.bin" ]
171 [ "//v8:run_mksnapshot_default($android_secondary_abi_toolchain)" ]
177 source_set("gin_test") {
189 "//base/test:test_support",
193 configs += [ "//v8:external_startup_data" ]
196 test("gin_unittests") {
198 "arguments_unittest.cc",
199 "array_buffer_unittest.cc",
200 "converter_unittest.cc",
201 "data_object_builder_unittest.cc",
202 "interceptor_unittest.cc",
203 "per_context_data_unittest.cc",
204 "shell_runner_unittest.cc",
205 "test/run_all_unittests.cc",
206 "time_clamper_unittest.cc",
207 "v8_isolate_memory_dump_provider_unittest.cc",
208 "v8_platform_unittest.cc",
209 "v8_shared_memory_dump_provider_unittest.cc",
210 "wrappable_unittest.cc",
215 "//base/test:test_support",
221 if (use_partition_alloc) {
222 sources += [ "v8_platform_page_allocator_unittest.cc" ]
223 if (target_cpu == "arm64" && (is_linux || is_android)) {
224 deps += [ "//base:arm_bti_testfunctions" ]
228 configs += [ "//v8:external_startup_data" ]
231 "//testing/buildbot/filters:gin_unittests_filters",
232 "//tools/v8_context_snapshot:v8_context_snapshot",
236 # gin_shell is not an Android/iOS app.
237 if (!is_android && !is_ios) {
238 sources += [ "shell/gin_shell_unittest.cc" ]
239 deps += [ ":gin_shell" ]
240 data_deps += [ ":gin_shell" ]
241 data += [ "shell/hello_world.js" ]
244 # On Android, the APK must bundle the startup data.
246 deps += [ ":v8_snapshot_assets" ]
250 additional_manifest_fragments =
251 [ "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml" ]