Android.bp中利用go语言做宏判断
bootstrap_go_package {
name: "soong-customer",
pkgPath: "android/soong/qcom/vibrator/aidl",
deps: [
"soong-android",
"soong-cc",
],
srcs: [
"select_libs.go",
],
pluginFor: ["soong_build"],
}
cc_customer_select_libs{
name: "libxxxxxxxx",
shared_libs: ["libc++", "libcutils", "liblog", "libutils"],
strip: {
none:true,
},
vendor: true,
}
select_libs.go中
package customer_select_libs
import (
"path"
"android/soong/android"
"android/soong/cc"
"fmt"
"strings"
)
type archProps struct {
Android_arm struct {
Srcs []string
}
Android_arm64 struct {
Srcs []string
}
Android_x86 struct {
Srcs []string
}
Android_x86_64