diff --git a/Android.bp b/Android.bp index 8769f77e..d543429a 100644 --- a/Android.bp +++ b/Android.bp @@ -155,6 +155,45 @@ cc_defaults { } +cc_library { + name: "libgbm", + defaults: ["minigbm_defaults"], + host_supported: true, + + srcs: [ + ":minigbm_core_files", + "gbm.c", + "gbm_helpers.c", + ], + + 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_headers"], + }, + android: { + shared_libs: [ + "libcutils", + "liblog", + ], + static_libs: [ + "libdrm", + ], + }, + }, + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], + vendor_available: true, + product_available: true, + + export_include_dirs: ["."], +} + // Intel cc_library_shared { name: "libminigbm_gralloc_intel", diff --git a/i915.c b/i915.c index 5a68a115..a1fb5e7b 100644 --- a/i915.c +++ b/i915.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "drv_helpers.h" #include "drv_priv.h"