或者宏B为y时,A,C,D为n,以此类推。可以使用以下代码实现:

config A bool "A" default n depends on !B && !C && !D

config B bool "B" default n depends on !A && !C && !D

config C bool "C" default n depends on !A && !B && !D

config D bool "D" default n depends on !A && !B && !C

这样定义后,当选中任意一个宏时,其它三个宏都会自动变为不选中状态。

kconfig定义宏ABCD并且相互之间反依赖即宏A为y时BCD为n

原文地址: https://www.cveoy.top/t/topic/bwnQ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录