1# C++ configuration options
2
3# Copyright (c) 2018 B. Leforestier
4# SPDX-License-Identifier: Apache-2.0
5
6menu "C++ Language Support"
7
8config CPP
9	bool "C++ support for the application"
10	help
11	  This option enables the use of applications built with C++.
12
13if CPP
14
15choice STD_CPP
16	prompt "C++ Standard"
17	default STD_CPP11
18	help
19	  C++ Standards.
20
21config STD_CPP98
22	bool "C++ 98"
23	help
24	  1998 C++ standard as modified by the 2003 technical corrigendum
25	  and some later defect reports.
26
27config STD_CPP11
28	bool "C++ 11"
29	help
30	  2011 C++ standard, previously known as C++0x.
31
32config STD_CPP14
33	bool "C++ 14"
34	help
35	  2014 C++ standard.
36
37config STD_CPP17
38	bool "C++ 17"
39	help
40	  2017 C++ standard, previously known as C++0x.
41
42config STD_CPP2A
43	bool "C++ 2a"
44	help
45	  Next revision of the C++ standard, which is expected to be published in 2020.
46
47config STD_CPP20
48	bool "C++ 20"
49	help
50	  2020 C++ standard, previously known as C++2A.
51
52config STD_CPP2B
53	bool "C++ 2b"
54	help
55	  Next revision of the C++ standard, which is expected to be published in 2023.
56
57endchoice
58
59config REQUIRES_FULL_LIBCPP
60	bool "Require complete C++ standard library"
61	select REQUIRES_FULL_LIBC
62	help
63	  Indicates that a full C++ standard library is required, either by
64	  a subsystem or an application. This will also include a full C
65	  library implementation.
66
67config FULL_LIBCPP_SUPPORTED
68	bool
69	help
70	  Selected when the target has at least one C++ library that offers a
71	  complete implementation and which would be selected when
72	  REQUIRES_FULL_LIBCPP is set.
73
74choice LIBCPP_IMPLEMENTATION
75	prompt "C++ Standard Library Implementation"
76	default EXTERNAL_LIBCPP if REQUIRES_FULL_LIBCPP && NATIVE_BUILD
77	default LIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP && "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm"
78	default GLIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP
79	default MINIMAL_LIBCPP
80
81config MINIMAL_LIBCPP
82	bool "Minimal C++ Library"
83	depends on !REQUIRES_FULL_LIBCPP
84	help
85	  Build with the minimal C++ library provided by Zephyr.
86
87	  The Zephyr minimal C++ library only provides a very limited subset
88	  of the standard C++ library and is mainly intended for use with the
89	  applications that do not require the Standard Template Library (STL).
90
91config GLIBCXX_LIBCPP
92	bool "GNU C++ Standard Library"
93	depends on !NATIVE_APPLICATION
94	depends on NEWLIB_LIBC || PICOLIBC
95	select FULL_LIBCPP_SUPPORTED
96	help
97	  Build with GNU C++ Standard Library (libstdc++) provided by the GNU
98	  Compiler Collection (GCC)-based toolchain.
99
100config LIBCXX_LIBCPP
101	bool "LLVM C++ Standard Library"
102	depends on !NATIVE_APPLICATION
103	depends on NEWLIB_LIBC
104	depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm"
105	select FULL_LIBCPP_SUPPORTED
106	help
107	  Build with LLVM C++ Standard Library (libc++) provided by LLVM
108	  toolchain. Information about library can be found at
109	  https://libcxx.llvm.org
110
111config ARCMWDT_LIBCPP
112	bool "ARC MWDT C++ Library"
113	depends on !NATIVE_APPLICATION
114	depends on ARCMWDT_LIBC
115	help
116	  Build with ARC MetaWare C++ Standard Library provided by the ARC
117	  MetaWare Development Tools (MWDT) toolchain.
118
119config EXTERNAL_LIBCPP
120	bool "External C++ standard library"
121	help
122	  Build and link with an external/user-provided C++ standard library.
123
124config EXTERNAL_MODULE_LIBCPP
125	bool "External C++ standard library module"
126	help
127	  Build an external/user-provided C++ standard library.
128
129endchoice # LIBCPP_IMPLEMENTATION
130
131if !MINIMAL_LIBCPP
132
133config CPP_EXCEPTIONS
134	bool "C++ exceptions support"
135	depends on !NEWLIB_LIBC_NANO
136	help
137	  This option enables support of C++ exceptions.
138
139config CPP_RTTI
140	bool "C++ RTTI support"
141	help
142	  This option enables support of C++ RTTI.
143
144endif # !MINIMAL_LIBCPP
145
146config CPP_STATIC_INIT_GNU
147	bool
148	select STATIC_INIT_GNU
149	select DEPRECATED
150	help
151	  GNU-compatible initialization of CPP static objects.
152	  This option is deprecated in favour of STATIC_INIT_GNU
153
154endif # CPP
155
156endmenu
157