MacViews: Use Mac's "Constrained Window Button" style for Button::STYLE_BUTTON LabelB...
[chromium-blink-merge.git] / chrome / browser / ui / libgtk2ui / BUILD.gn
blobb89e3d28c08f40d38f714cea756e01584f7b703d
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 assert(is_linux, "This file should only be referenced on Linux")
7 import("//build/config/features.gni")
9 component("libgtk2ui") {
10   sources = [
11     "app_indicator_icon.cc",
12     "app_indicator_icon.h",
13     "app_indicator_icon_menu.cc",
14     "app_indicator_icon_menu.h",
15     "chrome_gtk_frame.cc",
16     "chrome_gtk_frame.h",
17     "chrome_gtk_menu_subclasses.cc",
18     "chrome_gtk_menu_subclasses.h",
19     "g_object_destructor_filo.cc",
20     "g_object_destructor_filo.h",
21     "gtk2_border.cc",
22     "gtk2_border.h",
23     "gtk2_event_loop.cc",
24     "gtk2_event_loop.h",
25     "gtk2_key_bindings_handler.cc",
26     "gtk2_key_bindings_handler.h",
27     "gtk2_signal_registrar.cc",
28     "gtk2_signal_registrar.h",
29     "gtk2_status_icon.cc",
30     "gtk2_status_icon.h",
31     "gtk2_ui.cc",
32     "gtk2_ui.h",
33     "gtk2_util.cc",
34     "gtk2_util.h",
35     "libgtk2ui_export.h",
36     "menu_util.cc",
37     "menu_util.h",
38     "native_theme_gtk2.cc",
39     "native_theme_gtk2.h",
40     "owned_widget_gtk2.cc",
41     "owned_widget_gtk2.h",
42     "print_dialog_gtk2.cc",
43     "print_dialog_gtk2.h",
44     "printing_gtk2_util.cc",
45     "printing_gtk2_util.h",
46     "select_file_dialog_impl.cc",
47     "select_file_dialog_impl.h",
48     "select_file_dialog_impl_gtk2.cc",
49     "select_file_dialog_impl_kde.cc",
50     "skia_utils_gtk2.cc",
51     "skia_utils_gtk2.h",
52     "unity_service.cc",
53     "unity_service.h",
54     "x11_input_method_context_impl_gtk2.cc",
55     "x11_input_method_context_impl_gtk2.h",
56   ]
58   if (use_gconf) {
59     sources += [
60       "gconf_listener.cc",
61       "gconf_listener.h",
62     ]
63   }
64   defines = [
65     "LIBGTK2UI_IMPLEMENTATION",
67     # g_settings_list_schemas is deprecated, but this function is not
68     # available on earlier version that we still need to support.
69     # See build/config/linux/BUILD.gn:gio_config for details.
70     "GLIB_DISABLE_DEPRECATION_WARNINGS",
71   ]
73   configs += [
74     "//build/config/linux:gconf",
75     "//printing:cups",
76   ]
78   # GTK2 pulls pangoft2 as dependency, and pangoft2 depends on harfbuzz.
79   # To avoid missing indirectly referenced harfbuzz symbols from pango,
80   # some hack is required when bundled harfbuzz is used and component build is
81   # disabled.
82   # See crbug.com/462689 for details.
83   all_dependent_configs = [ "//third_party/harfbuzz-ng:pangoft2_link_hack" ]
85   # gn orders flags on a target before flags from configs. The default config
86   # adds -Wall, and these flags have to be after -Wall -- so they need to come
87   # from a config and can't be on the target directly.
88   config("libgtk2ui_warnings") {
89     if (is_clang) {
90       cflags = [
91         # G_DEFINE_TYPE automatically generates a *get_instance_private inline
92         # function after glib 2.37. That's unused. Prevent to complain about it.
93         "-Wno-unused-function",
95         # G_STATIC_ASSERT uses a typedef as a static_assert.
96         "-Wno-unused-local-typedef",
97       ]
98     }
99   }
100   configs += [
101     ":libgtk2ui_warnings",
102     "//build/config/linux:x11",
103   ]
105   deps = [
106     "//base",
107     "//base/third_party/dynamic_annotations",
108     "//base:i18n",
109     "//build/config/linux/gtk",
110     "//build/config/linux/gtk:gtkprint",
111     "//chrome/app/theme:theme_resources",
112     "//chrome:extra_resources",
113     "//chrome:resources",
114     "//chrome:strings",
115     "//components/resources",
116     "//content/public/browser",
117     "//mojo/environment:chromium",
118     "//printing",
119     "//skia",
120     "//third_party/mojo/src/mojo/edk/system",
121     "//ui/aura",
122     "//ui/base",
123     "//ui/base/ime",
124     "//ui/events",
125     "//ui/events:events_base",
126     "//ui/gfx",
127     "//ui/gfx/x",
128     "//ui/native_theme",
129     "//ui/resources",
130     "//ui/shell_dialogs",
131     "//ui/strings",
132     "//ui/views",
133   ]