1.aosp/build/make/core/soong_config.mk
+$(call add_json_bool, Cus_nfc_config, $(filter true,$(CUS_NFC_CONFIG))
2.aosp/build/soong/android/variable.go
在Product_variables struct下添加自己的宏控变量
+Cus_nfc_config struct {
+ Cflags []string
+ }
在 type productVariables struct下增加
+Cus_nfc_config *bool `json:",omitempty"
3.在你编译文件的android.bp中增加
+product_variables: {
+ cus_nfc_config: {
+ cflags: [
+ "-DCUS_NFC_CONFIG",
+ ],
+ },
+}
4.BoardConfig.mk中添加自定义宏控
+CUS_NFC_CONFIG := true