summaryrefslogtreecommitdiff
path: root/chromium/build/config/linux/BUILD.gn
blob: fda14196f3e5b1f294478d14c3e006c3d47c1272 (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
# Copyright (c) 2013 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/c++/c++.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")

group("linux") {
  visibility = [ "//:optimize_gn_gen" ]
}

# This is included by reference in the //build/config/compiler config that
# is applied to all targets. It is here to separate out the logic that is
# Linux-only. This is not applied to Android, but is applied to ChromeOS.
config("compiler") {
}

# This is included by reference in the //build/config/compiler:runtime_library
# config that is applied to all targets. It is here to separate out the logic
# that is Linux-only. Please see that target for advice on what should go in
# :runtime_library vs. :compiler.
config("runtime_library") {
  # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like
  # OS_LINUX and the like.
  if (is_chromeos) {
    defines = [ "OS_CHROMEOS" ]
  }

  if ((!(is_chromeos || chromeos_is_browser_only) ||
       default_toolchain != "//build/toolchain/cros:target") &&
      (!use_custom_libcxx || current_cpu == "mipsel")) {
    libs = [ "atomic" ]
  }
}

config("x11") {
  libs = [
    "X11",
    "X11-xcb",
    "xcb",
    "xcb-dri3",
    "Xcomposite",
    "Xcursor",
    "Xdamage",
    "Xext",
    "Xfixes",
    "Xi",
    "Xrender",
    "Xtst",
  ]
}

config("xcomposite") {
  libs = [ "Xcomposite" ]
}

config("xext") {
  libs = [ "Xext" ]
}

config("xfixes") {
  libs = [ "Xfixes" ]
}

config("libcap") {
  libs = [ "cap" ]
}

config("xi") {
  libs = [ "Xi" ]
}

config("xtst") {
  libs = [ "Xtst" ]
}

config("libresolv") {
  libs = [ "resolv" ]
}

if (use_glib) {
  pkg_config("glib") {
    packages = [
      "glib-2.0",
      "gmodule-2.0",
      "gobject-2.0",
      "gthread-2.0",
    ]
    defines = [
      "GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40",
      "GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40",
    ]
  }
}

# Ensures all exported symbols are added to the dynamic symbol table.  This is
# necessary to expose Chrome's custom operator new() and operator delete() (and
# other memory-related symbols) to libraries.  Otherwise, they might
# (de)allocate memory on a different heap, which would spell trouble if pointers
# to heap-allocated memory are passed over shared library boundaries.
config("export_dynamic") {
  ldflags = [ "-rdynamic" ]
}