OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 assert(is_linux, "This file should only be referenced on Linux") | 5 assert(is_linux, "This file should only be referenced on Linux") |
6 | 6 |
7 import("//build/config/features.gni") | 7 import("//build/config/features.gni") |
8 import("//build/config/ui.gni") | 8 import("//build/config/ui.gni") |
9 | 9 |
10 # gn orders flags on a target before flags from configs. The default config | 10 # gn orders flags on a target before flags from configs. The default config |
11 # adds -Wall, and these flags have to be after -Wall -- so they need to come | 11 # adds -Wall, and these flags have to be after -Wall -- so they need to come |
12 # from a config and can't be on the target directly. | 12 # from a config and can't be on the target directly. |
13 config("libgtk2ui_warnings") { | 13 config("libgtk2ui_warnings") { |
14 if (is_clang) { | 14 if (is_clang) { |
15 cflags = [ | 15 cflags = [ |
16 # G_DEFINE_TYPE automatically generates a *get_instance_private inline | 16 # G_DEFINE_TYPE automatically generates a *get_instance_private inline |
17 # function after glib 2.37. That's unused. Prevent to complain about it. | 17 # function after glib 2.37. That's unused. Prevent to complain about it. |
18 "-Wno-unused-function", | 18 "-Wno-unused-function", |
19 | 19 |
20 # G_STATIC_ASSERT uses a typedef as a static_assert. | 20 # G_STATIC_ASSERT uses a typedef as a static_assert. |
21 "-Wno-unused-local-typedef", | 21 "-Wno-unused-local-typedef", |
22 ] | 22 ] |
23 } | 23 } |
24 } | 24 } |
25 | 25 |
26 sources_common = [ | |
Dirk Pranke
2016/10/25 23:56:10
Nit: `common_sources` reads better.
Tom (Use chromium acct)
2016/10/26 18:20:01
Done.
| |
27 "app_indicator_icon.cc", | |
28 "app_indicator_icon.h", | |
29 "app_indicator_icon_menu.cc", | |
30 "app_indicator_icon_menu.h", | |
31 "chrome_gtk_frame.cc", | |
32 "chrome_gtk_frame.h", | |
33 "chrome_gtk_menu_subclasses.cc", | |
34 "chrome_gtk_menu_subclasses.h", | |
35 "gtk2_event_loop.cc", | |
36 "gtk2_event_loop.h", | |
37 "gtk2_key_bindings_handler.cc", | |
38 "gtk2_key_bindings_handler.h", | |
39 "gtk2_status_icon.cc", | |
40 "gtk2_status_icon.h", | |
41 "gtk2_ui.cc", | |
42 "gtk2_ui.h", | |
43 "gtk2_util.cc", | |
44 "gtk2_util.h", | |
45 "libgtk2ui_export.h", | |
46 "menu_util.cc", | |
47 "menu_util.h", | |
48 "native_theme_gtk2.cc", | |
49 "native_theme_gtk2.h", | |
50 "print_dialog_gtk2.cc", | |
51 "print_dialog_gtk2.h", | |
52 "printing_gtk2_util.cc", | |
53 "printing_gtk2_util.h", | |
54 "select_file_dialog_impl.cc", | |
55 "select_file_dialog_impl.h", | |
56 "select_file_dialog_impl_gtk2.cc", | |
57 "select_file_dialog_impl_gtk2.h", | |
58 "select_file_dialog_impl_kde.cc", | |
59 "skia_utils_gtk2.cc", | |
60 "skia_utils_gtk2.h", | |
61 "unity_service.cc", | |
62 "unity_service.h", | |
63 "x11_input_method_context_impl_gtk2.cc", | |
64 "x11_input_method_context_impl_gtk2.h", | |
65 ] | |
66 | |
67 configs_common = [] | |
Dirk Pranke
2016/10/25 23:56:10
common_configs.
You could also use `shared_source
Tom (Use chromium acct)
2016/10/26 18:20:01
Done.
| |
68 | |
69 if (use_gconf) { | |
70 sources_common += [ | |
71 "gconf_listener.cc", | |
72 "gconf_listener.h", | |
73 ] | |
74 configs_common += [ "//build/config/linux/gconf" ] | |
75 } | |
76 | |
77 if (use_cups) { | |
78 configs_common += [ "//printing:cups" ] | |
79 } | |
80 | |
81 configs_common += [ | |
82 ":libgtk2ui_warnings", | |
83 "//build/config/linux:x11", | |
84 ] | |
85 | |
86 deps_common = [ | |
Dirk Pranke
2016/10/25 23:56:10
common_deps, etc.
Tom (Use chromium acct)
2016/10/26 18:20:01
Done.
| |
87 "//base", | |
88 "//base:i18n", | |
89 "//base/third_party/dynamic_annotations", | |
90 "//chrome:extra_resources", | |
91 "//chrome:resources", | |
92 "//chrome:strings", | |
93 "//chrome/app:command_ids", | |
94 "//chrome/app/theme:theme_resources", | |
95 "//components/resources", | |
96 "//content/public/browser", | |
97 "//printing", | |
98 "//skia", | |
99 "//ui/aura", | |
100 "//ui/base", | |
101 "//ui/base/ime", | |
102 "//ui/display", | |
103 "//ui/events", | |
104 "//ui/events:events_base", | |
105 "//ui/events/platform/x11", | |
106 "//ui/gfx", | |
107 "//ui/gfx/geometry", | |
108 "//ui/gfx/x", | |
109 "//ui/native_theme", | |
110 "//ui/resources", | |
111 "//ui/shell_dialogs", | |
112 "//ui/strings", | |
113 "//ui/views", | |
114 ] | |
115 | |
26 component("libgtk2ui") { | 116 component("libgtk2ui") { |
27 sources = [ | 117 sources = sources_common |
28 "app_indicator_icon.cc", | 118 configs += configs_common |
29 "app_indicator_icon.h", | |
30 "app_indicator_icon_menu.cc", | |
31 "app_indicator_icon_menu.h", | |
32 "chrome_gtk_frame.cc", | |
33 "chrome_gtk_frame.h", | |
34 "chrome_gtk_menu_subclasses.cc", | |
35 "chrome_gtk_menu_subclasses.h", | |
36 "gtk2_event_loop.cc", | |
37 "gtk2_event_loop.h", | |
38 "gtk2_key_bindings_handler.cc", | |
39 "gtk2_key_bindings_handler.h", | |
40 "gtk2_status_icon.cc", | |
41 "gtk2_status_icon.h", | |
42 "gtk2_ui.cc", | |
43 "gtk2_ui.h", | |
44 "gtk2_util.cc", | |
45 "gtk2_util.h", | |
46 "libgtk2ui_export.h", | |
47 "menu_util.cc", | |
48 "menu_util.h", | |
49 "native_theme_gtk2.cc", | |
50 "native_theme_gtk2.h", | |
51 "print_dialog_gtk2.cc", | |
52 "print_dialog_gtk2.h", | |
53 "printing_gtk2_util.cc", | |
54 "printing_gtk2_util.h", | |
55 "select_file_dialog_impl.cc", | |
56 "select_file_dialog_impl.h", | |
57 "select_file_dialog_impl_gtk2.cc", | |
58 "select_file_dialog_impl_gtk2.h", | |
59 "select_file_dialog_impl_kde.cc", | |
60 "skia_utils_gtk2.cc", | |
61 "skia_utils_gtk2.h", | |
62 "unity_service.cc", | |
63 "unity_service.h", | |
64 "x11_input_method_context_impl_gtk2.cc", | |
65 "x11_input_method_context_impl_gtk2.h", | |
66 ] | |
67 | |
68 if (use_gconf) { | |
69 sources += [ | |
70 "gconf_listener.cc", | |
71 "gconf_listener.h", | |
72 ] | |
73 configs += [ "//build/config/linux/gconf" ] | |
74 } | |
75 defines = [ "LIBGTK2UI_IMPLEMENTATION" ] | 119 defines = [ "LIBGTK2UI_IMPLEMENTATION" ] |
76 | 120 |
77 if (use_cups) { | |
78 configs += [ "//printing:cups" ] | |
79 } | |
80 | |
81 # GTK2 pulls pangoft2 as dependency, and pangoft2 depends on harfbuzz. | 121 # GTK2 pulls pangoft2 as dependency, and pangoft2 depends on harfbuzz. |
82 # To avoid missing indirectly referenced harfbuzz symbols from pango, | 122 # To avoid missing indirectly referenced harfbuzz symbols from pango, |
83 # some hack is required when bundled harfbuzz is used and component build is | 123 # some hack is required when bundled harfbuzz is used and component build is |
84 # disabled. | 124 # disabled. |
85 # See crbug.com/462689 for details. | 125 # See crbug.com/462689 for details. |
86 all_dependent_configs = [ "//third_party/harfbuzz-ng:pangoft2_link_hack" ] | 126 all_dependent_configs = [ "//third_party/harfbuzz-ng:pangoft2_link_hack" ] |
87 | 127 |
88 configs += [ | 128 deps = deps_common |
89 ":libgtk2ui_warnings", | 129 deps += [ |
Dirk Pranke
2016/10/25 23:56:10
These two lines can be collapsed to `deps = common
Tom (Use chromium acct)
2016/10/26 18:20:01
Done.
| |
90 "//build/config/linux:x11", | 130 "//build/config/linux/gtk2", |
131 "//build/config/linux/gtk2:gtkprint2", | |
91 ] | 132 ] |
133 } | |
92 | 134 |
93 deps = [ | 135 component("libgtk3ui") { |
94 "//base", | 136 sources = sources_common |
95 "//base:i18n", | 137 configs += configs_common |
96 "//base/third_party/dynamic_annotations", | 138 defines = [ "LIBGTK2UI_IMPLEMENTATION" ] |
97 "//chrome:extra_resources", | 139 |
98 "//chrome:resources", | 140 deps = deps_common |
99 "//chrome:strings", | 141 deps += [ |
100 "//chrome/app:command_ids", | 142 "//build/config/linux/gtk3", |
101 "//chrome/app/theme:theme_resources", | 143 "//build/config/linux/gtk3:gtkprint3", |
102 "//components/resources", | |
103 "//content/public/browser", | |
104 "//printing", | |
105 "//skia", | |
106 "//ui/aura", | |
107 "//ui/base", | |
108 "//ui/base/ime", | |
109 "//ui/display", | |
110 "//ui/events", | |
111 "//ui/events:events_base", | |
112 "//ui/events/platform/x11", | |
113 "//ui/gfx", | |
114 "//ui/gfx/geometry", | |
115 "//ui/gfx/x", | |
116 "//ui/native_theme", | |
117 "//ui/resources", | |
118 "//ui/shell_dialogs", | |
119 "//ui/strings", | |
120 "//ui/views", | |
121 ] | 144 ] |
122 | |
123 if (use_gtk3) { | |
124 deps += [ | |
125 "//build/config/linux/gtk3", | |
126 "//build/config/linux/gtk3:gtkprint3", | |
127 ] | |
128 } else { | |
129 deps += [ | |
130 "//build/config/linux/gtk2", | |
131 "//build/config/linux/gtk2:gtkprint2", | |
132 ] | |
133 } | |
134 } | 145 } |
OLD | NEW |