Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / gpu / config / BUILD.gn
index 8e7b04d..27e377d 100644 (file)
@@ -4,6 +4,11 @@
 
 import("//build/config/ui.gni")
 
+declare_args() {
+  # Use the PCI lib to collect GPU information on Linux.
+  use_libpci = true
+}
+
 source_set("config") {
   sources = [
     "dx_diag_node.cc",
@@ -22,6 +27,8 @@ source_set("config") {
     "gpu_info.cc",
     "gpu_info.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",
@@ -38,22 +45,38 @@ source_set("config") {
     "software_rendering_list_json.cc",
   ]
 
+  defines = [ "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) {
+    if (is_chrome_branded && is_official_build) {
       sources += [
         "//third_party/amd/AmdCfxPxExt.h",
         "//third_party/amd/amd_videocard_info_win.cc",
       ]
     }
+
+    # TODO(jschuh): size_t to int.
+    cflags = [ "/wd4267" ]
+  }
+  if (use_libpci) {
+    defines += [ "USE_LIBPCI=1" ]
+  }
+  if (is_linux && use_libpci && (use_x11 || use_ozone)) {
+    deps += [
+      "//build/config/linux:libpci",
+    ]
   }
   if (is_linux && use_x11) {
     configs += [
@@ -61,7 +84,6 @@ source_set("config") {
       "//build/config/linux:xext",
     ]
     deps += [
-      "//build/config/linux:libpci",
       "//third_party/libXNVCtrl",
     ]
   } else {