AIDEGen:fix module_bp_cc_deps.json content error.
Bug: 147324044
Test: 1. export SOONG_COLLECT_CC_DEPS=1 SOONG_GEN_CMAKEFILES=1;m nothing
module_bp_cc_deps.json will be generated.
In module_bp_cc_deps.json,
"libui": {
...
"system_include_flags": {
"header_search_path": [
"system/core/include",
"system/media/audio/include",
"hardware/libhardware/include",
"hardware/libhardware_legacy/include",
"hardware/ril/include",
"frameworks/native/include",
"frameworks/native/opengl/include",
"frameworks/av/include",
"libnativehelper/include_jni"
]
"system_search_path": [
"bionic/libc/include",
"bionic/libc/kernel/uapi",
"bionic/libc/kernel/uapi/asm-x86",
"bionic/libc/kernel/android/scsi",
"bionic/libc/kernel/android/uapi"
]
},
...
},
Change-Id: Iabc638ca451f568b2a4c09327f8f3c220f6fc154
diff --git a/cc/ccdeps.go b/cc/ccdeps.go
index 9b89110..4e23a7b 100644
--- a/cc/ccdeps.go
+++ b/cc/ccdeps.go
@@ -142,7 +142,7 @@
compilerParams.HeaderSearchPath =
append(compilerParams.HeaderSearchPath, strings.TrimPrefix(param, "-I"))
case systemHeaderSearchPath:
- if i < len(params)-1 {
+ if i < len(cparams)-1 {
compilerParams.SystemHeaderSearchPath = append(compilerParams.SystemHeaderSearchPath, cparams[i+1])
}
i = i + 1