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/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
9 gypi_values = exec_script("//build/gypi_to_gn.py",
10 [ rebase_path("views.gyp") ],
15 defines = [ "TOOLKIT_VIEWS=1" ]
19 all_dependent_configs = [ ":flags" ]
20 sources = gypi_values.views_sources
22 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
23 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
25 defines = [ "VIEWS_IMPLEMENTATION" ]
29 "//base/third_party/dynamic_annotations",
36 "//ui/views/resources",
42 "//ui/accessibility:ax_gen",
47 "//ui/events:events_base",
48 "//ui/events/platform",
51 "//ui/views/resources",
54 if (use_x11 && !is_chromeos) {
55 deps += [ "//ui/display/util" ]
57 if (is_linux && !is_chromeos) {
58 sources -= [ "window/window_button_order_provider.cc" ]
59 deps += [ "//ui/shell_dialogs" ]
62 "linux_ui/linux_ui.cc",
63 "linux_ui/linux_ui.h",
64 "linux_ui/window_button_order_observer.h",
65 "linux_ui/window_button_order_provider.cc",
71 "linux_ui/status_icon_linux.cc",
72 "linux_ui/status_icon_linux.h",
77 sources += gypi_values.views_win_sources
83 ldflags = [ "/DELAYLOAD:user32.dll" ]
85 "//third_party/iaccessible2",
91 deps += [ "//ui/ozone" ]
95 "//build/config/linux:x11",
96 "//build/config/linux:xrandr",
99 "//ui/events/devices",
100 "//ui/events/platform/x11",
106 sources += gypi_values.views_aura_sources
109 "//ui/touch_selection",
113 sources += gypi_values.views_desktop_aura_sources
115 sources += gypi_values.views_desktop_aura_x11_sources
116 configs += [ "//ui/accessibility:atk" ]
118 sources += gypi_values.views_desktop_aura_win_sources
119 } else if (use_ozone) {
120 sources += gypi_values.views_desktop_aura_ozone_sources
123 sources += gypi_values.views_desktop_aura_linux_sources
129 deps += [ "//ui/accelerated_widget_mac" ]
131 # Required by bridged_native_widget.mm.
132 "QuartzCore.framework",
137 static_library("test_support") {
139 sources = gypi_values.views_test_support_sources
146 "//ipc:test_support",
152 "//ui/compositor:test_support",
154 "//ui/events:events_base",
155 "//ui/events:test_support",
156 "//ui/events/platform",
162 sources += gypi_values.views_test_support_aura_sources
165 "//ui/aura:test_support",
168 if (use_x11 && !is_chromeos) {
169 sources += gypi_values.views_test_support_desktop_aura_x11_sources
173 deps += [ "//ui/gfx/x" ]
175 if (use_ozone || !use_x11) {
176 sources -= [ "test/x11_property_change_waiter.cc" ]
180 test("views_unittests") {
181 sources = gypi_values.views_unittests_sources
188 "//base/test:test_support",
192 "//ui/accessibility",
195 "//ui/base:test_support",
196 "//ui/compositor:test_support",
197 "//ui/events:test_support",
198 "//ui/events:events_base",
199 "//ui/events/platform",
210 "//third_party/iaccessible2",
221 # 'VCManifestTool': {
222 # 'AdditionalManifestFiles': [
223 # '$(ProjectDir)\\test\\views_unittest.manifest',
231 "//build/config/linux:x11",
232 "//build/config/linux:xext",
235 "//ui/events/devices",
236 "//ui/events/platform/x11",
242 sources += gypi_values.views_unittests_aura_sources
245 "//ui/aura:test_support",
246 "//ui/touch_selection",
250 sources += gypi_values.views_unittests_desktop_aura_sources
252 sources += gypi_values.views_unittests_desktop_aurax11_sources
257 sources += gypi_values.views_unittests_desktop_sources
261 "//ui/events/platform/x11",
267 # views_unittests not yet compiling on Mac. http://crbug.com/378134
269 "bubble/bubble_window_targeter_unittest.cc",
270 "controls/native/native_view_host_unittest.cc",
271 "widget/window_reorderer_unittest.cc",
273 deps += [ "//ui/accelerated_widget_mac" ]
278 test("macviews_interactive_ui_tests") {
280 "cocoa/bridged_native_widget_interactive_uitest.mm",
281 "run_all_unittests.cc",
282 "widget/native_widget_mac_interactive_uitest.mm",
288 "//base/test:test_support",
291 "//ui/base:test_support",
294 "//ui/resources:ui_test_pak",