summaryrefslogtreecommitdiffstats
path: root/gpu/config/BUILD.gn
blob: 3ca9edff16800f32e3349c70a220acbd83d50886 (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
# Copyright 2014 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/chrome_build.gni")
import("//build/config/ui.gni")

declare_args() {
  # Use the PCI lib to collect GPU information on Linux.
  use_libpci = is_linux && !is_chromecast && (use_x11 || use_ozone)
}

group("config") {
  if (is_component_build) {
    public_deps = [
      "//gpu",
    ]
  } else {
    public_deps = [
      ":config_sources",
    ]
  }
}

source_set("config_sources") {
  visibility = [
    "//components/mus/gles2:*",
    "//gpu/*",
  ]

  sources = [
    "dx_diag_node.cc",
    "dx_diag_node.h",
    "gpu_blacklist.cc",
    "gpu_blacklist.h",
    "gpu_control_list.cc",
    "gpu_control_list.h",
    "gpu_control_list_jsons.h",
    "gpu_driver_bug_list.cc",
    "gpu_driver_bug_list.h",
    "gpu_driver_bug_list_json.cc",
    "gpu_driver_bug_workaround_type.h",
    "gpu_dx_diagnostics_win.cc",
    "gpu_feature_type.h",
    "gpu_info.cc",
    "gpu_info.h",
    "gpu_info_collector.cc",
    "gpu_info_collector.h",
    "gpu_info_collector_android.cc",
    "gpu_info_collector_linux.cc",
    "gpu_info_collector_linux.h",
    "gpu_info_collector_mac.mm",
    "gpu_info_collector_ozone.cc",
    "gpu_info_collector_win.cc",
    "gpu_info_collector_x11.cc",
    "gpu_switches.cc",
    "gpu_switches.h",
    "gpu_test_config.cc",
    "gpu_test_config.h",
    "gpu_test_expectations_parser.cc",
    "gpu_test_expectations_parser.h",
    "gpu_util.cc",
    "gpu_util.h",
    "software_rendering_list_json.cc",
  ]

  configs += [
    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
    "//build/config/compiler:no_size_t_to_int_warning",
    "//gpu:gpu_implementation",
  ]

  deps = [
    "//base",
    "//third_party/re2",
    "//ui/gl",
  ]

  # Prefer mesa GL headers to system headers, which cause problems on Win.
  include_dirs = [ "//third_party/mesa/src/include" ]

  if (is_win) {
    deps += [ "//third_party/libxml" ]
    libs = [
      "dxguid.lib",
      "setupapi.lib",
    ]

    if (is_chrome_branded && is_official_build) {
      sources += [
        "//third_party/amd/AmdCfxPxExt.h",
        "//third_party/amd/amd_videocard_info_win.cc",
      ]
    }
  }
  if (use_libpci) {
    defines = [ "USE_LIBPCI=1" ]
    deps += [ "//build/linux:libpci" ]
  }
  if (is_linux && use_x11) {
    configs += [
      "//build/config/linux:x11",
      "//build/config/linux:xext",
    ]
    deps += [
      "//third_party/libXNVCtrl",
      "//ui/gfx/x",
    ]
  } else {
    sources -= [ "gpu_info_collector_x11.cc" ]
  }
  if (!use_ozone) {
    sources -= [ "gpu_info_collector_ozone.cc" ]
  }
}