OSDN Git Service

Skip ab/6749736 in stage.
authorXin Li <delphij@google.com>
Fri, 9 Oct 2020 06:14:04 +0000 (23:14 -0700)
committerXin Li <delphij@google.com>
Fri, 9 Oct 2020 06:14:04 +0000 (23:14 -0700)
Bug: 167233921
Merged-In: I534acc55a351de6fe94194de9dba4f55ba43558f
Change-Id: I290151f7e04c9c738e06e0859c10cc86f4943aa4

Android.bp

index b853e58..d074e46 100644 (file)
@@ -38,10 +38,6 @@ cc_defaults {
     ],
 
     cppflags: ["-std=c++14"],
-
-    shared_libs: [
-        "libdrm",
-    ],
 }
 
 cc_defaults {
@@ -77,16 +73,17 @@ cc_defaults {
 
     shared_libs: [
         "libcutils",
+        "libdrm",
         "libnativewindow",
         "libsync",
         "liblog",
     ],
 }
 
-cc_library_host_shared {
-    name: "libgbm",
+cc_defaults {
+    name: "gbm_defaults",
+
     defaults: ["minigbm_defaults"],
-    static_libs: ["libdrm"],
 
     srcs: [
         "gbm.c",
@@ -96,6 +93,28 @@ cc_library_host_shared {
     export_include_dirs: ["."],
 }
 
+cc_library {
+    name: "libgbm",
+    defaults: ["gbm_defaults"],
+    host_supported: true,
+
+    target: {
+        host: {
+            // Avoid linking to another host copy of libdrm; this library will cause
+            // binary GPU drivers to be loaded from the host, which might be linked
+            // to a system copy of libdrm, which conflicts with the AOSP one
+            allow_undefined_symbols: true,
+            header_libs: ["libdrm"],
+        },
+        android: {
+            shared_libs: [
+                "libdrm",
+                "liblog"
+            ],
+        },
+    },
+}
+
 cc_library_static {
     name: "libminigbm_cros_gralloc",
     defaults: ["minigbm_cros_gralloc_defaults"],