OLD | NEW |
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2015 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 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 import("//build/config/linux/pkg_config.gni") | 6 import("//build/config/linux/pkg_config.gni") |
7 import("//tools/generate_library_loader/generate_library_loader.gni") | |
8 | |
9 gypi_values = exec_script("//build/gypi_to_gn.py", | |
10 [ rebase_path("system.gyp") ], | |
11 "scope", | |
12 [ "system.gyp" ]) | |
13 | 7 |
14 # If brlapi isn't needed, don't require it to be installed. | 8 # If brlapi isn't needed, don't require it to be installed. |
15 if (use_brlapi) { | 9 if (use_brlapi) { |
16 config("brlapi_config") { | 10 config("brlapi_config") { |
17 defines = [ "USE_BRLAPI" ] | 11 defines = [ "USE_BRLAPI" ] |
18 } | 12 } |
19 | 13 |
20 # TODO(GYP) linux_link_brlapi support. Is this needed? | 14 deps = [ |
21 generate_library_loader("libbrlapi") { | 15 "//build/linux/libbrlapi:libbrlapi", |
22 name = "LibBrlapiLoader" | 16 ] |
23 output_h = "libbrlapi.h" | |
24 output_cc = "libbrlapi_loader.cc" | |
25 header = "<brlapi.h>" | |
26 config = ":brlapi_config" | |
27 | |
28 functions = gypi_values.libbrlapi_functions | |
29 } | |
30 } | 17 } |
31 if (use_gio) { | 18 if (use_gio) { |
32 pkg_config("gio_config") { | 19 pkg_config("gio_config") { |
33 packages = [ "gio-2.0" ] | 20 packages = [ "gio-2.0" ] |
34 | 21 |
35 # glib >=2.40 deprecate g_settings_list_schemas in favor of | 22 # glib >=2.40 deprecate g_settings_list_schemas in favor of |
36 # g_settings_schema_source_list_schemas. This function is not available on | 23 # g_settings_schema_source_list_schemas. This function is not available on |
37 # earlier versions that we still need to support (specifically, 2.32), so | 24 # earlier versions that we still need to support (specifically, 2.32), so |
38 # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define. | 25 # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define. |
39 # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu | 26 # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu |
40 # 13.10 (saucy) and earlier. Update the code to use | 27 # 13.10 (saucy) and earlier. Update the code to use |
41 # g_settings_schema_source_list_schemas instead. | 28 # g_settings_schema_source_list_schemas instead. |
42 defines = [ | 29 defines = [ |
43 "USE_GIO", | 30 "USE_GIO", |
44 "GLIB_DISABLE_DEPRECATION_WARNINGS", | 31 "GLIB_DISABLE_DEPRECATION_WARNINGS", |
45 ] | 32 ] |
46 | 33 |
47 # TODO(brettw) Theoretically I think ignore_libs should be set so that we | 34 # TODO(brettw) Theoretically I think ignore_libs should be set so that we |
48 # don't link directly to GIO and use the loader generated below. But the | 35 # don't link directly to GIO and use the loader generated below. But the |
49 # gio target in GYP doesn't make any sense to me and appears to link | 36 # gio target in GYP doesn't make any sense to me and appears to link |
50 # directly to GIO in addition to making a loader. This this uncommented, | 37 # directly to GIO in addition to making a loader. This this uncommented, |
51 # the link in component build fails, so I think this is closer to the | 38 # the link in component build fails, so I think this is closer to the |
52 # GYP build. | 39 # GYP build. |
53 #ignore_libs = true # Loader generated below. | 40 #ignore_libs = true # Loader generated below. |
54 } | 41 } |
55 | 42 |
56 # This generates a target named "gio". | 43 deps = [ |
57 generate_library_loader("gio") { | 44 "//build/linux/libgio:gio", |
58 name = "LibGioLoader" | 45 ] |
59 output_h = "libgio.h" | |
60 output_cc = "libgio_loader.cc" | |
61 header = "<gio/gio.h>" | |
62 config = "//build/linux:gio_config" | |
63 | |
64 functions = gypi_values.libgio_functions | |
65 } | |
66 } | |
67 | |
68 # This generates a target named "libpci". | |
69 generate_library_loader("libpci") { | |
70 name = "LibPciLoader" | |
71 output_h = "libpci.h" | |
72 output_cc = "libpci_loader.cc" | |
73 header = "<pci/pci.h>" | |
74 | |
75 functions = gypi_values.libpci_functions | |
76 } | 46 } |
77 | 47 |
78 # Looking for libspeechd? Use //third_party/speech-dispatcher | 48 # Looking for libspeechd? Use //third_party/speech-dispatcher |
79 | 49 |
80 # This generates a target named "udev0_loader". | |
81 generate_library_loader("udev0_loader") { | |
82 name = "LibUdev0Loader" | |
83 output_h = "libudev0.h" | |
84 output_cc = "libudev0_loader.cc" | |
85 header = "\"third_party/libudev/libudev0.h\"" | |
86 | |
87 functions = gypi_values.libudev_functions | |
88 } | |
89 | |
90 # This generates a target named "udev1_loader". | |
91 generate_library_loader("udev1_loader") { | |
92 name = "LibUdev1Loader" | |
93 output_h = "libudev1.h" | |
94 output_cc = "libudev1_loader.cc" | |
95 header = "\"third_party/libudev/libudev1.h\"" | |
96 | |
97 functions = gypi_values.libudev_functions | |
98 } | |
99 | |
100 group("udev") { | |
101 public_deps = [ | |
102 ":udev0_loader", | |
103 ":udev1_loader", | |
104 ] | |
105 } | |
106 | |
107 group("fontconfig") { | 50 group("fontconfig") { |
108 if (is_chromecast) { | 51 if (is_chromecast) { |
109 # Chromecast platform does not provide fontconfig | 52 # Chromecast platform does not provide fontconfig |
110 public_deps = [ | 53 public_deps = [ |
111 "//third_party/fontconfig", | 54 "//third_party/fontconfig", |
112 ] | 55 ] |
113 } else { | 56 } else { |
114 public_configs = [ "//build/config/linux:fontconfig" ] | 57 public_configs = [ "//build/config/linux:fontconfig" ] |
115 } | 58 } |
116 } | 59 } |
117 | 60 |
118 if (!is_chromecast) { | 61 if (!is_chromecast) { |
119 pkg_config("freetype2_config") { | 62 pkg_config("freetype2_config") { |
120 visibility = [ ":freetype2" ] | 63 visibility = [ ":freetype2" ] |
121 packages = [ "freetype2" ] | 64 packages = [ "freetype2" ] |
122 } | 65 } |
123 } | 66 } |
124 | 67 |
125 group("freetype2") { | 68 group("freetype2") { |
126 if (is_chromecast) { | 69 if (is_chromecast) { |
127 # Chromecast platform doesn't provide freetype, so use Chromium's. | 70 # Chromecast platform doesn't provide freetype, so use Chromium's. |
128 # The version in freetype-android is unmodified from freetype2 upstream. | 71 # The version in freetype-android is unmodified from freetype2 upstream. |
129 public_deps = [ | 72 public_deps = [ |
130 "//third_party/freetype-android:freetype", | 73 "//third_party/freetype-android:freetype", |
131 ] | 74 ] |
132 } else { | 75 } else { |
133 public_configs = [ ":freetype2_config" ] | 76 public_configs = [ ":freetype2_config" ] |
134 } | 77 } |
135 } | 78 } |
OLD | NEW |