summaryrefslogtreecommitdiffstats
path: root/build/linux/BUILD.gn
blob: 97428b4eda155cdb87cc70d91ab057c3f23eefb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/features.gni")
import("//build/config/linux/pkg_config.gni")
import("//tools/generate_library_loader/generate_library_loader.gni")

gypi_values = exec_script("//build/gypi_to_gn.py",
                          [ rebase_path("system.gyp") ],
                          "scope",
                          [ "system.gyp" ])

# If brlapi isn't needed, don't require it to be installed.
if (use_brlapi) {
  config("brlapi_config") {
    defines = [ "USE_BRLAPI" ]
  }

  # TODO(GYP) linux_link_brlapi support. Is this needed?
  generate_library_loader("libbrlapi") {
    name = "LibBrlapiLoader"
    output_h = "libbrlapi.h"
    output_cc = "libbrlapi_loader.cc"
    header = "<brlapi.h>"
    config = ":brlapi_config"

    functions = gypi_values.libbrlapi_functions
  }
}
if (use_gio) {
  pkg_config("gio_config") {
    packages = [ "gio-2.0" ]

    # glib >=2.40 deprecate g_settings_list_schemas in favor of
    # g_settings_schema_source_list_schemas. This function is not available on
    # earlier versions that we still need to support (specifically, 2.32), so
    # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define.
    # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu
    # 13.10 (saucy) and earlier. Update the code to use
    # g_settings_schema_source_list_schemas instead.
    defines = [
      "USE_GIO",
      "GLIB_DISABLE_DEPRECATION_WARNINGS",
    ]

    # TODO(brettw) Theoretically I think ignore_libs should be set so that we
    # don't link directly to GIO and use the loader generated below. But the
    # gio target in GYP doesn't make any sense to me and appears to link
    # directly to GIO in addition to making a loader. This this uncommented,
    # the link in component build fails, so I think this is closer to the
    # GYP build.
    #ignore_libs = true  # Loader generated below.
  }

  # This generates a target named "gio".
  generate_library_loader("gio") {
    name = "LibGioLoader"
    output_h = "libgio.h"
    output_cc = "libgio_loader.cc"
    header = "<gio/gio.h>"
    config = "//build/linux:gio_config"

    functions = gypi_values.libgio_functions
  }
}

# This generates a target named "libpci".
generate_library_loader("libpci") {
  name = "LibPciLoader"
  output_h = "libpci.h"
  output_cc = "libpci_loader.cc"
  header = "<pci/pci.h>"

  functions = gypi_values.libpci_functions
}

# Looking for libspeechd? Use //third_party/speech-dispatcher

# This generates a target named "udev0_loader".
generate_library_loader("udev0_loader") {
  name = "LibUdev0Loader"
  output_h = "libudev0.h"
  output_cc = "libudev0_loader.cc"
  header = "\"third_party/libudev/libudev0.h\""

  functions = gypi_values.libudev_functions
}

# This generates a target named "udev1_loader".
generate_library_loader("udev1_loader") {
  name = "LibUdev1Loader"
  output_h = "libudev1.h"
  output_cc = "libudev1_loader.cc"
  header = "\"third_party/libudev/libudev1.h\""

  functions = gypi_values.libudev_functions
}

group("udev") {
  public_deps = [
    ":udev0_loader",
    ":udev1_loader",
  ]
}

group("fontconfig") {
  if (is_chromecast) {
    # Chromecast platform does not provide fontconfig
    public_deps = [
      "//third_party/fontconfig",
    ]
  } else {
    public_configs = [ "//build/config/linux:fontconfig" ]
  }
}

group("freetype2") {
  if (is_chromecast) {
    # Chromecast platform doesn't provide freetype, so use Chromium's.
    # The version in freetype-android is unmodified from freetype2 upstream.
    public_deps = [
      "//third_party/freetype-android:freetype",
    ]
  } else {
    public_configs = [ "//build/config/linux:freetype2" ]
  }
}