Skip to content

Commit e4dc66b

Browse files
Hirokazu HondaXinfengZhang
Hirokazu Honda
authored andcommitted
Fix include directories and generated header files in Android.bp
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.
1 parent 25381db commit e4dc66b

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

Android.bp

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,23 @@ sh_binary_host {
3636
}
3737

3838
genrule {
39-
name: "libva_gen_version",
39+
name: "libva_gen_headers",
4040
srcs: [
4141
"configure.ac",
4242
"va/va_version.h.in",
43+
"va/drm/va_drm.h",
4344
],
4445
tools: [
4546
"libva_gen_version_script",
4647
],
47-
out: ["va/va_version.h"],
48+
out: [
49+
"va/va_version.h",
50+
"va/va_drm.h",
51+
],
4852
cmd: "$(location libva_gen_version_script) " +
49-
"$$(dirname $(location configure.ac)) " +
50-
"$(location va/va_version.h.in) > $(out)",
53+
"$$(dirname $(location configure.ac)) " +
54+
"$(location va/va_version.h.in) > $(location va/va_version.h);" +
55+
"cp $(location va/drm/va_drm.h) $(location va/va_drm.h)",
5156
}
5257

5358
cc_library_headers {
@@ -56,14 +61,14 @@ cc_library_headers {
5661
export_include_dirs: [
5762
".",
5863
"va",
59-
"va/drm"
64+
"va/drm",
6065
],
6166

6267
generated_headers: [
63-
"libva_gen_version",
68+
"libva_gen_headers",
6469
],
6570
export_generated_headers: [
66-
"libva_gen_version",
71+
"libva_gen_headers",
6772
],
6873

6974
vendor: true,
@@ -86,14 +91,17 @@ cc_library_shared {
8691
],
8792

8893
local_include_dirs: [
89-
"va"
94+
"va",
9095
],
9196

9297
generated_headers: [
93-
"libva_gen_version",
98+
"libva_gen_headers",
9499
],
95100
export_generated_headers: [
96-
"libva_gen_version",
101+
"libva_gen_headers",
102+
],
103+
export_include_dirs: [
104+
".",
97105
],
98106

99107
header_libs: [
@@ -140,6 +148,15 @@ cc_library_shared {
140148
"va",
141149
"va/drm",
142150
],
151+
generated_headers: [
152+
"libva_gen_headers",
153+
],
154+
export_generated_headers: [
155+
"libva_gen_headers",
156+
],
157+
export_include_dirs: [
158+
".",
159+
],
143160

144161
srcs: [
145162
"va/android/va_android.cpp",

0 commit comments

Comments
 (0)