Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / web / BUILD.gn
blob3442625c3ad1c9f9e74496fe4759ef84c36acc88
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/config/ui.gni")
6 import("//testing/test.gni")
7 import("//third_party/WebKit/Source/bindings/bindings.gni")
8 import("//third_party/WebKit/Source/config.gni")
9 import("//third_party/WebKit/Source/core/core.gni")
10 import("//third_party/WebKit/Source/modules/modules.gni")
11 import("//third_party/WebKit/Source/platform/platform.gni")
13 visibility = [ "//third_party/WebKit/*" ]
14 web_gypi = exec_script(
15     "//build/gypi_to_gn.py",
16     [ rebase_path("web.gypi") ],
17     "scope",
18     [ "web.gypi" ])
21 component("web") {
22   output_name = "blink_web"
24   deps = [
25     "//third_party/WebKit/Source/core",
26     "//third_party/WebKit/Source/modules",
27     "//third_party/WebKit/Source/platform",
28     "//skia",
29     "//third_party/icu",
30     "//v8",
31     "//third_party/angle:translator",
32   ]
34   include_dirs = [
35     "//third_party/skia/include/utils",
36   ]
38   configs += [
39     "//third_party/WebKit/Source:config",
40     "//third_party/WebKit/Source:inside_blink",
41     "//third_party/WebKit/Source:non_test_config",
42   ]
44   sources = web_gypi.web_files
46   if (!use_default_render_theme) {
47     sources -= [ "default/WebRenderTheme.cpp" ]
48   }
50   if (is_component_build) {
51     deps += [
52       "//base/test:test_support",
53       "//testing/gmock",
54       "//testing/gtest",
55       "//third_party/WebKit/Source/core:testing",
56       "//third_party/WebKit/Source/modules:modules_testing",
57       "//third_party/WebKit/Source/platform:test_support",
58       "//third_party/WebKit/Source/wtf:test_support",
59     ]
61     configs -= [
62       "//third_party/WebKit/Source:non_test_config",
63     ]
65     sources += web_gypi.web_unittest_files
66     sources += bindings_unittest_files
67     sources += core_unittest_files
68     sources += modules_unittest_files
69     sources += platform_unittest_support_files
70     sources += platform_web_unittest_files
72     sources += [ "WebTestingSupport.cpp" ]
73     include_dirs += [ "$root_gen_dir/blink" ]
74   }
76   if (is_android) {
77     set_sources_assignment_filter([])
78     sources += [ "linux/WebFontRendering.cpp" ]
79     set_sources_assignment_filter(sources_assignment_filter)
80   }
83 # GYP version: WebKit/Source/web/web.gyp:blink_web_test_support
84 source_set("test_support") {
85   if (!is_component_build) {
86     deps = [
87       "//skia",
88       "//third_party/WebKit/Source/core:testing",
89       "//third_party/WebKit/Source/modules:modules_testing",
90       "//third_party/WebKit/Source/wtf",
91       "//v8",
92     ]
94     sources = [ "WebTestingSupport.cpp" ]
96     configs += [
97       "//third_party/WebKit/Source:config",
98     ]
100     include_dirs = [
101       "$root_gen_dir/blink",
102     ]
103   }
106 # GYP version: WebKit/Source/web/web_tests.gyp:webkit_unit_tests
107 if (!is_mac) {
108   # TODO(GYP): Can't link Blink binaries yet on mac.
109   test("webkit_unit_tests") {
110     visibility = []  # Allow re-assignment of list.
111     visibility = [ "*" ]
113     deps = [
114       ":test_support",
115       ":web",
116       "//base",
117       "//base/test:test_support",
118       "//base:i18n",
119       "//content/test:test_support",
120       "//testing/gmock",
121       "//testing/gtest",
122       "//third_party/WebKit/Source/platform:test_support",
123       "//third_party/WebKit/Source/wtf:test_support",
124       "//third_party/libwebp",
125       "//third_party/zlib",
126       "//url",
127       "//v8",
128     ]
130     sources = [ "tests/RunAllTests.cpp" ]
132     configs += [ "//third_party/WebKit/Source:config" ]
134     if (!is_component_build) {
135       deps += [ "//third_party/WebKit/Source/core" ]
137       configs += [ "//third_party/WebKit/Source:inside_blink" ]
139       sources += web_gypi.web_unittest_files
140       sources += bindings_unittest_files
141       sources += core_unittest_files
142       sources += modules_unittest_files
143       sources += platform_unittest_support_files
144       sources += platform_web_unittest_files
145     }
146   }