OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 assert(is_linux, "This file should only be referenced on Linux") |
| 6 |
| 7 import("//build/config/features.gni") |
| 8 import("//build/config/ui.gni") |
| 9 |
| 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 |
| 12 # from a config and can't be on the target directly. |
| 13 config("libgtkui_warnings") { |
| 14 if (is_clang) { |
| 15 cflags = [ |
| 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. |
| 18 "-Wno-unused-function", |
| 19 |
| 20 # G_STATIC_ASSERT uses a typedef as a static_assert. |
| 21 "-Wno-unused-local-typedef", |
| 22 ] |
| 23 } |
| 24 } |
| 25 |
| 26 common_sources = [ |
| 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 "libgtkui_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 common_configs = [] |
| 68 |
| 69 if (use_gconf) { |
| 70 common_sources += [ |
| 71 "gconf_listener.cc", |
| 72 "gconf_listener.h", |
| 73 ] |
| 74 common_configs += [ "//build/config/linux/gconf" ] |
| 75 } |
| 76 |
| 77 if (use_cups) { |
| 78 common_configs += [ "//printing:cups" ] |
| 79 } |
| 80 |
| 81 common_configs += [ |
| 82 ":libgtkui_warnings", |
| 83 "//build/config/linux:x11", |
| 84 ] |
| 85 |
| 86 common_deps = [ |
| 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 |
| 116 component("libgtk2ui") { |
| 117 sources = common_sources |
| 118 configs += common_configs |
| 119 defines = [ "LIBGTKUI_IMPLEMENTATION" ] |
| 120 |
| 121 # GTK2 pulls pangoft2 as dependency, and pangoft2 depends on harfbuzz. |
| 122 # To avoid missing indirectly referenced harfbuzz symbols from pango, |
| 123 # some hack is required when bundled harfbuzz is used and component build is |
| 124 # disabled. |
| 125 # See crbug.com/462689 for details. |
| 126 all_dependent_configs = [ "//third_party/harfbuzz-ng:pangoft2_link_hack" ] |
| 127 |
| 128 deps = common_deps + [ |
| 129 "//build/config/linux/gtk2", |
| 130 "//build/config/linux/gtk2:gtkprint2", |
| 131 ] |
| 132 public_deps = [ |
| 133 "//chrome/browser:theme_properties", |
| 134 ] |
| 135 } |
| 136 |
| 137 component("libgtk3ui") { |
| 138 sources = common_sources |
| 139 configs += common_configs |
| 140 defines = [ "LIBGTKUI_IMPLEMENTATION" ] |
| 141 |
| 142 deps = common_deps + [ |
| 143 "//build/config/linux/gtk3", |
| 144 "//build/config/linux/gtk3:gtkprint3", |
| 145 ] |
| 146 public_deps = [ |
| 147 "//chrome/browser:theme_properties", |
| 148 ] |
| 149 } |
OLD | NEW |