OSDN Git Service

ANDROID: Add target/device support am: 8884508fa6 am: cf0ceff91e am: 96f63775f7 am...
[android-x86/external-minigbm.git] / Android.bp
index ab5b9e0..d074e46 100644 (file)
@@ -1,8 +1,5 @@
-/*
- * Copyright 2020 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
 
 cc_defaults {
     name: "minigbm_defaults",
@@ -44,7 +41,7 @@ cc_defaults {
 }
 
 cc_defaults {
-    name: "minigbm_gralloc_defaults",
+    name: "minigbm_cros_gralloc_defaults",
 
     defaults: ["minigbm_defaults"],
 
@@ -81,12 +78,11 @@ cc_defaults {
         "libsync",
         "liblog",
     ],
-
-    relative_install_path: "hw",
 }
 
-cc_library_host_shared {
-    name: "libgbm",
+cc_defaults {
+    name: "gbm_defaults",
+
     defaults: ["minigbm_defaults"],
 
     srcs: [
@@ -95,17 +91,33 @@ cc_library_host_shared {
     ],
 
     export_include_dirs: ["."],
+}
 
-    // 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"],
+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_gralloc",
-    defaults: ["minigbm_gralloc_defaults"],
+    name: "libminigbm_cros_gralloc",
+    defaults: ["minigbm_cros_gralloc_defaults"],
     shared_libs: ["liblog"],
     static_libs: ["libdrm"],
 
@@ -114,13 +126,13 @@ cc_library_static {
 
 cc_library_shared {
     name: "gralloc.minigbm",
-    defaults: ["minigbm_gralloc_defaults"],
+    defaults: ["minigbm_cros_gralloc_defaults"],
     srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
 }
 
 cc_library_shared {
     name: "gralloc.minigbm_intel",
-    defaults: ["minigbm_gralloc_defaults"],
+    defaults: ["minigbm_cros_gralloc_defaults"],
     enabled: false,
     arch: {
         x86: {
@@ -136,7 +148,7 @@ cc_library_shared {
 
 cc_library_shared {
     name: "gralloc.minigbm_meson",
-    defaults: ["minigbm_gralloc_defaults"],
+    defaults: ["minigbm_cros_gralloc_defaults"],
     cflags: ["-DDRV_MESON"],
     srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
 }