kconfig: cpp: Have LIB_CPLUSPLUS depend on ! MINIMAL_LIBC

The C++ STD library is not compatible with the minimal C library. To
ensure that users do not accidentally enable LIB_CPLUSPLUS while also
enabling a minimal libc library we add a dependency in Kconfig.

Also, use depends instead of select between EXCEPTIONS, RTTI, and
LIB_CPLUSPLUS as use of select is discouraged in this situation.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2019-08-13 15:17:01 +02:00 committed by Alberto Escolar
commit 540bd67a7d

View file

@ -44,25 +44,25 @@ config STD_CPP2A
endchoice endchoice
if ! MINIMAL_LIBC
config LIB_CPLUSPLUS config LIB_CPLUSPLUS
bool "Link with STD C++ library" bool "Link with STD C++ library"
help help
Link with STD C++ Library. Link with STD C++ Library.
if LIB_CPLUSPLUS
config EXCEPTIONS config EXCEPTIONS
bool "Enable C++ exceptions support" bool "Enable C++ exceptions support"
select LIB_CPLUSPLUS
depends on !MINIMAL_LIBC
help help
This option enables support of C++ exceptions. This option enables support of C++ exceptions.
config RTTI config RTTI
bool "Enable C++ RTTI support" bool "Enable C++ RTTI support"
select LIB_CPLUSPLUS
help help
This option enables support of C++ RTTI. This option enables support of C++ RTTI.
if LIB_CPLUSPLUS
config ZEPHYR_CPLUSPLUS config ZEPHYR_CPLUSPLUS
bool "Use Zephyr C++ Implementation" bool "Use Zephyr C++ Implementation"
@ -72,4 +72,6 @@ config ZEPHYR_CPLUSPLUS
endif # LIB_CPLUSPLUS endif # LIB_CPLUSPLUS
endif # ! MINIMAL_LIBC
endif # CPLUSPLUS endif # CPLUSPLUS