Skip to contentSkip to conversation

invisible choices in kconfig

DISCUSSION Jonas Gorski 1 participant 1 message Sep 3, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi,

I'm trying to add* an "conditionally invisible choice" to kconfig, but it seems like visibility is treated like a dependency in contrast to "normal" prompt-less or invisible menu options.

Is this intentional?

A simplified version of what I'm trying to have is

config FOO
bool "Foo"

choice
prompt "Baz" if FOO
default BAZ_A

config BAZ_A
bool "Baz A"

config BAZ_B
bool "Baz B"

endchoice

But unless FOO is set, neither BAZ_A nor BAZ_B will appear in .config or will be set.

The obvious workaround is to define a duplicate set of hidden BAZ config values that will get selected by the BAZ choice values. But then they also need to copy the defaults from the choice and this gets dirty really fast and easily out of sync, in addition of introducing twice as many config symbols.

Regards
Jonas

* actually I already added one in the expectation that it works that way. The default non prompt value isn't checked anywhere, only the non-default options are, so it "worked" as expected, so I didn't noticed it was broken.