gn2bp: Added required include PATH
When -sysroot=build/linux/debian_bullseye_amd64-sysroot is passed,
build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu
also should be in the include path.
Test: ./update_results.sh
Change-Id: I9bdf8d0711bb9f91e118eed8aef8db5c7520126c
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 4bd2479..5c3ac46 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -1153,7 +1153,10 @@
# include. So adding sysroot include at the end.
for flag in target.cflags:
if '--sysroot' in flag:
- module.local_include_dirs.append(flag[len('--sysroot=../../'):] + "/usr/include")
+ sysroot = flag[len('--sysroot=../../'):]
+ if sysroot == "build/linux/debian_bullseye_amd64-sysroot":
+ module.local_include_dirs.append(sysroot + "/usr/include/x86_64-linux-gnu")
+ module.local_include_dirs.append(sysroot + "/usr/include")
module_is_compiled = module.type not in ('genrule', 'filegroup')
if module_is_compiled: