Roll src/third_party/skia 723b050:98ed7b6
[chromium-blink-merge.git] / gin / BUILD.gn
blob45350747bfe32dd6a6f61bb1fed3402201301061
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
3 # found in the LICENSE file.
5 import("//build/module_args/v8.gni")
6 import("//testing/test.gni")
8 component("gin") {
9   sources = [
10     "arguments.cc",
11     "arguments.h",
12     "array_buffer.cc",
13     "array_buffer.h",
14     "context_holder.cc",
15     "converter.cc",
16     "converter.h",
17     "debug_impl.cc",
18     "debug_impl.h",
19     "dictionary.cc",
20     "dictionary.h",
21     "function_template.cc",
22     "function_template.h",
23     "gin_export.h",
24     "handle.h",
25     "interceptor.cc",
26     "interceptor.h",
27     "isolate_holder.cc",
28     "modules/console.cc",
29     "modules/console.h",
30     "modules/file_module_provider.cc",
31     "modules/file_module_provider.h",
32     "modules/module_registry.cc",
33     "modules/module_registry.h",
34     "modules/module_registry_observer.h",
35     "modules/module_runner_delegate.cc",
36     "modules/module_runner_delegate.h",
37     "modules/timer.cc",
38     "modules/timer.h",
39     "object_template_builder.cc",
40     "object_template_builder.h",
41     "per_context_data.cc",
42     "per_context_data.h",
43     "per_isolate_data.cc",
44     "per_isolate_data.h",
45     "public/context_holder.h",
46     "public/debug.h",
47     "public/gin_embedders.h",
48     "public/isolate_holder.h",
49     "public/v8_idle_task_runner.h",
50     "public/v8_platform.h",
51     "public/wrapper_info.h",
52     "run_microtasks_observer.cc",
53     "run_microtasks_observer.h",
54     "runner.cc",
55     "runner.h",
56     "shell_runner.cc",
57     "shell_runner.h",
58     "try_catch.cc",
59     "try_catch.h",
60     "v8_initializer.cc",
61     "v8_initializer.h",
62     "v8_isolate_memory_dump_provider.cc",
63     "v8_isolate_memory_dump_provider.h",
64     "v8_platform.cc",
65     "wrappable.cc",
66     "wrappable.h",
67     "wrapper_info.cc",
68   ]
70   if (v8_use_external_startup_data) {
71     data = [
72       "$root_out_dir/natives_blob.bin",
73       "$root_out_dir/snapshot_blob.bin",
74     ]
75   }
77   defines = [ "GIN_IMPLEMENTATION" ]
79   public_deps = [
80     "//base",
81     "//v8",
82   ]
83   deps = [
84     "//base/third_party/dynamic_annotations",
85   ]
86   if (v8_use_external_startup_data && is_win) {
87     public_deps += [ ":gin_v8_snapshot_fingerprint" ]
88     deps += [ "//crypto:crypto" ]
89     sources += [ "$target_gen_dir/v8_snapshot_fingerprint.cc" ]
90     defines += [ "V8_VERIFY_EXTERNAL_STARTUP_DATA" ]
91   }
94 if (v8_use_external_startup_data) {
95   action("gin_v8_snapshot_fingerprint") {
96     script = "//gin/fingerprint/fingerprint_v8_snapshot.py"
98     snapshot_file = "$root_build_dir/snapshot_blob.bin"
99     natives_file = "$root_build_dir/natives_blob.bin"
100     output_file = "$target_gen_dir/v8_snapshot_fingerprint.cc"
102     args = [
103       "--snapshot_file",
104       rebase_path(snapshot_file, root_build_dir),
105       "--natives_file",
106       rebase_path(natives_file, root_build_dir),
107       "--output_file",
108       rebase_path(output_file, root_build_dir),
109     ]
110     inputs = [
111       snapshot_file,
112       natives_file,
113     ]
114     outputs = [
115       output_file,
116     ]
118     deps = [
119       "//v8",
120     ]
121   }
124 executable("gin_shell") {
125   sources = [
126     "shell/gin_main.cc",
127   ]
129   deps = [
130     ":gin",
131     "//base",
132     "//base:i18n",
133     "//build/config/sanitizers:deps",
134     "//v8",
135   ]
138 source_set("gin_test") {
139   testonly = true
140   sources = [
141     "test/file.cc",
142     "test/file.h",
143     "test/file_runner.cc",
144     "test/file_runner.h",
145     "test/gc.cc",
146     "test/gc.h",
147     "test/gtest.cc",
148     "test/gtest.h",
149     "test/v8_test.cc",
150     "test/v8_test.h",
151   ]
153   public_deps = [
154     ":gin",
155     "//testing/gtest",
156   ]
157   deps = [
158     "//v8",
159   ]
162 test("gin_unittests") {
163   sources = [
164     "converter_unittest.cc",
165     "interceptor_unittest.cc",
166     "modules/module_registry_unittest.cc",
167     "modules/timer_unittest.cc",
168     "per_context_data_unittest.cc",
169     "shell/gin_shell_unittest.cc",
170     "shell_runner_unittest.cc",
171     "test/run_all_unittests.cc",
172     "test/run_js_tests.cc",
173     "v8_isolate_memory_dump_provider_unittest.cc",
174     "wrappable_unittest.cc",
175   ]
177   deps = [
178     ":gin_test",
179     "//base/test:test_support",
180     "//v8",
181   ]