From 540bd67a7d1088fceaddc519f9f5f96f7a9e2ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Tue, 13 Aug 2019 15:17:01 +0200 Subject: [PATCH] kconfig: cpp: Have LIB_CPLUSPLUS depend on ! MINIMAL_LIBC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- subsys/cpp/Kconfig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/subsys/cpp/Kconfig b/subsys/cpp/Kconfig index 369e97ab2dd..fa502b5374b 100644 --- a/subsys/cpp/Kconfig +++ b/subsys/cpp/Kconfig @@ -44,25 +44,25 @@ config STD_CPP2A endchoice +if ! MINIMAL_LIBC + config LIB_CPLUSPLUS bool "Link with STD C++ library" help Link with STD C++ Library. +if LIB_CPLUSPLUS + config EXCEPTIONS bool "Enable C++ exceptions support" - select LIB_CPLUSPLUS - depends on !MINIMAL_LIBC help This option enables support of C++ exceptions. config RTTI bool "Enable C++ RTTI support" - select LIB_CPLUSPLUS help This option enables support of C++ RTTI. -if LIB_CPLUSPLUS config ZEPHYR_CPLUSPLUS bool "Use Zephyr C++ Implementation" @@ -72,4 +72,6 @@ config ZEPHYR_CPLUSPLUS endif # LIB_CPLUSPLUS +endif # ! MINIMAL_LIBC + endif # CPLUSPLUS