Roll src/third_party/skia f5872d2:ef0b4e7
[chromium-blink-merge.git] / gin / BUILD.gn
blobd389b84d325aac3641dcf0e50f84eb4fb67ea4c2
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")
7 component("gin") {
8   sources = [
9     "arguments.cc",
10     "arguments.h",
11     "array_buffer.cc",
12     "array_buffer.h",
13     "context_holder.cc",
14     "converter.cc",
15     "converter.h",
16     "debug_impl.cc",
17     "debug_impl.h",
18     "dictionary.cc",
19     "dictionary.h",
20     "function_template.cc",
21     "function_template.h",
22     "gin_export.h",
23     "handle.h",
24     "interceptor.cc",
25     "interceptor.h",
26     "isolate_holder.cc",
27     "modules/console.cc",
28     "modules/console.h",
29     "modules/file_module_provider.cc",
30     "modules/file_module_provider.h",
31     "modules/module_registry.cc",
32     "modules/module_registry.h",
33     "modules/module_registry_observer.h",
34     "modules/module_runner_delegate.cc",
35     "modules/module_runner_delegate.h",
36     "modules/timer.cc",
37     "modules/timer.h",
38     "object_template_builder.cc",
39     "object_template_builder.h",
40     "per_context_data.cc",
41     "per_context_data.h",
42     "per_isolate_data.cc",
43     "per_isolate_data.h",
44     "public/context_holder.h",
45     "public/debug.h",
46     "public/gin_embedders.h",
47     "public/isolate_holder.h",
48     "public/v8_platform.h",
49     "public/wrapper_info.h",
50     "runner.cc",
51     "runner.h",
52     "run_microtasks_observer.cc",
53     "run_microtasks_observer.h",
54     "shell_runner.cc",
55     "shell_runner.h",
56     "try_catch.cc",
57     "try_catch.h",
58     "v8_platform.cc",
59     "wrappable.cc",
60     "wrappable.h",
61     "wrapper_info.cc",
62   ]
64   defines = [ "GIN_IMPLEMENTATION" ]
66   public_deps = [
67     "//base",
68     "//v8",
69   ]
70   deps = [
71     "//base/third_party/dynamic_annotations",
72   ]
73   if (v8_use_external_startup_data && is_win) {
74     deps += [
75       ":gin_v8_snapshot_fingerprint",
76       "//crypto:crypto",
77     ]
78     sources += [ "$target_gen_dir/v8_snapshot_fingerprint.cc" ]
79     defines += [ "V8_VERIFY_EXTERNAL_STARTUP_DATA" ]
80   }
83 if (v8_use_external_startup_data) {
84   action("gin_v8_snapshot_fingerprint") {
85     script = "//gin/fingerprint/fingerprint_v8_snapshot.py"
87     snapshot_file = "$root_build_dir/snapshot_blob.bin"
88     natives_file = "$root_build_dir/natives_blob.bin"
89     output_file = "$target_gen_dir/v8_snapshot_fingerprint.cc"
91     args = [
92       "--snapshot_file",
93       rebase_path(snapshot_file, root_build_dir),
94       "--natives_file",
95       rebase_path(natives_file, root_build_dir),
96       "--output_file",
97       rebase_path(output_file, root_build_dir),
98     ]
99     inputs = [
100       snapshot_file,
101       natives_file,
102     ]
103     outputs = [
104       output_file,
105     ]
106   }
109 executable("gin_shell") {
110   sources = [
111     "shell/gin_main.cc",
112   ]
114   deps = [
115     ":gin",
116     "//base",
117     "//base:i18n",
118     "//v8",
119   ]
122 source_set("gin_test") {
123   testonly = true
124   sources = [
125     "test/file.cc",
126     "test/file.h",
127     "test/file_runner.cc",
128     "test/file_runner.h",
129     "test/gc.cc",
130     "test/gc.h",
131     "test/gtest.cc",
132     "test/gtest.h",
133     "test/v8_test.cc",
134     "test/v8_test.h",
135   ]
137   public_deps = [
138     ":gin",
139     "//testing/gtest",
140   ]
141   deps = [
142     "//v8",
143   ]
146 test("gin_unittests") {
147   sources = [
148     "converter_unittest.cc",
149     "interceptor_unittest.cc",
150     "modules/module_registry_unittest.cc",
151     "modules/timer_unittest.cc",
152     "per_context_data_unittest.cc",
153     "shell_runner_unittest.cc",
154     "shell/gin_shell_unittest.cc",
155     "test/run_all_unittests.cc",
156     "test/run_js_tests.cc",
157     "wrappable_unittest.cc",
158   ]
160   deps = [
161     ":gin_test",
162     "//base/test:test_support",
163     "//v8",
164   ]