Skip to content

Commit

Permalink
Fix include directories and generated header files in Android.bp
Browse files Browse the repository at this point in the history
The build artifact of libva has va_drm.h in va/ directory. This
is done by va/drm/Makefile.am in libva. Therefore, code typically
includes va/va_drm.h. This CL modifies Android.bp so
`libva_gen_headers` copy va_drm.h in va/ directory and `libva` sets
include path to the generated headers.
  • Loading branch information
Hirokazu Honda authored and XinfengZhang committed Nov 28, 2024
1 parent 25381db commit e4dc66b
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,23 @@ sh_binary_host {
}

genrule {
name: "libva_gen_version",
name: "libva_gen_headers",
srcs: [
"configure.ac",
"va/va_version.h.in",
"va/drm/va_drm.h",
],
tools: [
"libva_gen_version_script",
],
out: ["va/va_version.h"],
out: [
"va/va_version.h",
"va/va_drm.h",
],
cmd: "$(location libva_gen_version_script) " +
"$$(dirname $(location configure.ac)) " +
"$(location va/va_version.h.in) > $(out)",
"$$(dirname $(location configure.ac)) " +
"$(location va/va_version.h.in) > $(location va/va_version.h);" +
"cp $(location va/drm/va_drm.h) $(location va/va_drm.h)",
}

cc_library_headers {
Expand All @@ -56,14 +61,14 @@ cc_library_headers {
export_include_dirs: [
".",
"va",
"va/drm"
"va/drm",
],

generated_headers: [
"libva_gen_version",
"libva_gen_headers",
],
export_generated_headers: [
"libva_gen_version",
"libva_gen_headers",
],

vendor: true,
Expand All @@ -86,14 +91,17 @@ cc_library_shared {
],

local_include_dirs: [
"va"
"va",
],

generated_headers: [
"libva_gen_version",
"libva_gen_headers",
],
export_generated_headers: [
"libva_gen_version",
"libva_gen_headers",
],
export_include_dirs: [
".",
],

header_libs: [
Expand Down Expand Up @@ -140,6 +148,15 @@ cc_library_shared {
"va",
"va/drm",
],
generated_headers: [
"libva_gen_headers",
],
export_generated_headers: [
"libva_gen_headers",
],
export_include_dirs: [
".",
],

srcs: [
"va/android/va_android.cpp",
Expand Down

0 comments on commit e4dc66b

Please sign in to comment.