Skip to content
Browse files

doc: kconfig: Clarify that 'depends on' works for string/int/hex

Seems people are a bit hazy on this, so explain how it works.

Signed-off-by: Ulf Magnusson <>
  • Loading branch information...
ulfalizer authored and nashif committed May 23, 2019
1 parent 344d4bd commit 7c8bcf0772e1dc5635d96f823d76ef2e90afb0f5
Showing with 25 additions and 0 deletions.
  1. +25 −0 doc/guides/kconfig/index.rst
@@ -326,6 +326,31 @@ error-prone, since it can be hard to spot that the same dependency is added

``depends on`` and ``string``/``int``/``hex`` symbols

``depends on`` works not just for ``bool`` symbols, but also for ``string``,
``int``, and ``hex`` symbols (and for choices).

The Kconfig definitions below will hide the ``FOO_DEVICE_FREQUENCY`` symbol and
disable any configuration output for it when ``FOO_DEVICE`` is disabled.

.. code-block:: none

bool "Foo device"

int "Foo device frequency"
depends on FOO_DEVICE

In general, it's a good idea to check that only relevant symbols are ever shown
in the ``menuconfig`` interface. Having ``FOO_DEVICE_FREQUENCY`` show up when
``FOO_DEVICE`` is disabled (and possibly hidden) makes the relationship between
the symbols harder to understand, even if code never looks at
``FOO_DEVICE_FREQUENCY`` when ``FOO_DEVICE`` is disabled.

Checking changes in ``menuconfig``

0 comments on commit 7c8bcf0

Please sign in to comment.
You can’t perform that action at this time.