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 GLIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP
78	default MINIMAL_LIBCPP
79
80config MINIMAL_LIBCPP
81	bool "Minimal C++ Library"
82	depends on !REQUIRES_FULL_LIBCPP
83	help
84	  Build with the minimal C++ library provided by Zephyr.
85
86	  The Zephyr minimal C++ library only provides a very limited subset
87	  of the standard C++ library and is mainly intended for use with the
88	  applications that do not require the Standard Template Library (STL).
89
90config GLIBCXX_LIBCPP
91	bool "GNU C++ Standard Library"
92	depends on !NATIVE_APPLICATION
93	depends on NEWLIB_LIBC || PICOLIBC
94	select FULL_LIBCPP_SUPPORTED
95	help
96	  Build with GNU C++ Standard Library (libstdc++) provided by the GNU
97	  Compiler Collection (GCC)-based toolchain.
98
99config ARCMWDT_LIBCPP
100	bool "ARC MWDT C++ Library"
101	depends on !NATIVE_APPLICATION
102	depends on ARCMWDT_LIBC
103	help
104	  Build with ARC MetaWare C++ Standard Library provided by the ARC
105	  MetaWare Development Tools (MWDT) toolchain.
106
107config EXTERNAL_LIBCPP
108	bool "External C++ standard library"
109	help
110	  Build and link with an external/user-provided C++ standard library.
111
112config EXTERNAL_MODULE_LIBCPP
113	bool "External C++ standard library module"
114	help
115	  Build an external/user-provided C++ standard library.
116
117endchoice # LIBCPP_IMPLEMENTATION
118
119config CPP_MAIN
120	bool "[DEPRECATED] C++ main() function definition"
121	select DEPRECATED
122	help
123	  This option used to be necessary to instruct the Zephyr kernel to
124	  call 'int main(void)' instead of the old Zephyr default, 'void
125	  main(void)'.
126
127	  As the Zephyr type now matches the C++ required type, this option
128	  is no longer necessary.
129
130if !MINIMAL_LIBCPP
131
132config CPP_EXCEPTIONS
133	bool "C++ exceptions support"
134	depends on !NEWLIB_LIBC_NANO
135	help
136	  This option enables support of C++ exceptions.
137
138config CPP_RTTI
139	bool "C++ RTTI support"
140	help
141	  This option enables support of C++ RTTI.
142
143endif # !MINIMAL_LIBCPP
144
145config CPP_STATIC_INIT_GNU
146	# As of today only ARC MWDT toolchain doesn't support GNU-compatible
147	# initialization of CPP static objects, new toolchains can be added
148	# here if required.
149	def_bool "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "arcmwdt"
150	help
151	  GNU-compatible initialization of CPP static objects
152
153endif # CPP
154
155rsource "Kconfig.deprecated"
156
157endmenu
158