Enable -Wl,-z,defs for ozone builds
[chromium-blink-merge.git] / gpu / config / BUILD.gn
blobbe7a444d5cb5812045e611216cdb02751115a344
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.
5 import("//build/config/ui.gni")
7 declare_args() {
8   # Use the PCI lib to collect GPU information on Linux.
9   use_libpci = true
12 source_set("config") {
13   sources = [
14     "dx_diag_node.cc",
15     "dx_diag_node.h",
16     "gpu_blacklist.cc",
17     "gpu_blacklist.h",
18     "gpu_control_list_jsons.h",
19     "gpu_control_list.cc",
20     "gpu_control_list.h",
21     "gpu_driver_bug_list_json.cc",
22     "gpu_driver_bug_list.cc",
23     "gpu_driver_bug_list.h",
24     "gpu_driver_bug_workaround_type.h",
25     "gpu_dx_diagnostics_win.cc",
26     "gpu_feature_type.h",
27     "gpu_info.cc",
28     "gpu_info.h",
29     "gpu_info_collector_android.cc",
30     "gpu_info_collector_linux.cc",
31     "gpu_info_collector_linux.h",
32     "gpu_info_collector_mac.mm",
33     "gpu_info_collector_ozone.cc",
34     "gpu_info_collector_win.cc",
35     "gpu_info_collector_x11.cc",
36     "gpu_info_collector.cc",
37     "gpu_info_collector.h",
38     "gpu_performance_stats.h",
39     "gpu_test_config.cc",
40     "gpu_test_config.h",
41     "gpu_test_expectations_parser.cc",
42     "gpu_test_expectations_parser.h",
43     "gpu_util.cc",
44     "gpu_util.h",
45     "software_rendering_list_json.cc",
46   ]
48   defines = [ "GPU_IMPLEMENTATION" ]
50   deps = [
51     "//base",
52     "//third_party/re2",
53     "//ui/gl",
54   ]
56   # Prefer mesa GL headers to system headers, which cause problems on Win.
57   include_dirs = [ "//third_party/mesa/src/include" ]
59   if (is_win) {
60     deps += [ "//third_party/libxml" ]
61     libs = [
62       "dxguid.lib",
63       "setupapi.lib",
64     ]
66     if (is_chrome_branded && is_official_build) {
67       sources += [
68         "//third_party/amd/AmdCfxPxExt.h",
69         "//third_party/amd/amd_videocard_info_win.cc",
70       ]
71     }
73     # TODO(jschuh): size_t to int.
74     cflags = [ "/wd4267" ]
75   }
76   if (use_libpci) {
77     defines += [ "USE_LIBPCI=1" ]
78   }
79   if (is_linux && use_libpci && (use_x11 || use_ozone)) {
80     deps += [ "//build/config/linux:libpci" ]
81   }
82   if (is_linux && use_x11) {
83     configs += [
84       "//build/config/linux:x11",
85       "//build/config/linux:xext",
86     ]
87     deps += [
88       "//third_party/libXNVCtrl",
89       "//ui/gfx/x",
90     ]
91   } else {
92     sources -= [ "gpu_info_collector_x11.cc" ]
93   }
94   if (!use_ozone) {
95     sources -= [ "gpu_info_collector_ozone.cc" ]
96   }