From 8884508fa662f8e2b11ea1639006fb0e17d65483 Mon Sep 17 00:00:00 2001 From: Alistair Delva Date: Fri, 28 Aug 2020 13:42:24 -0700 Subject: [PATCH] ANDROID: Add target/device support Support building libgbm.so for an Android guest. Change-Id: I1f9d729f847ad9bdd3c8746681e0df00c2107419 --- Android.bp | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/Android.bp b/Android.bp index ab5b9e0..c3b56e5 100644 --- a/Android.bp +++ b/Android.bp @@ -85,8 +85,9 @@ cc_defaults { relative_install_path: "hw", } -cc_library_host_shared { - name: "libgbm", +cc_defaults { + name: "gbm_defaults", + defaults: ["minigbm_defaults"], srcs: [ @@ -95,12 +96,28 @@ 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 { -- 2.11.0