lib: cpp: Relocate subsys/cpp to lib/cpp

This commit moves the files under `subsys/cpp` directory to the
`lib/cpp` directory because the C++ ABI runtime library and the
standard C++ library components are not a "subsystem" (aka. API) in
conventional sense and is better described as a "library."

Classifying the C++ ABI runtime library and the standard C++ library as
"libraries" instead of "subsystems" also better aligns with how the
existing C standard library implementation (`lib/libc`) is handled.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
This commit is contained in:
Stephanos Ioannidis 2022-12-08 20:54:28 +09:00 committed by Christopher Friedt
parent 9d2fe69b4e
commit feaab27c1b
18 changed files with 13 additions and 13 deletions

View File

@ -286,9 +286,9 @@ Build system:
- alexanderwachter
- cfriedt
files:
- subsys/cpp/
- tests/subsys/cpp/
- samples/subsys/cpp/
- lib/cpp/
- tests/lib/cpp/
- samples/cpp/
labels:
- "area: C++"

View File

@ -63,19 +63,19 @@ In order to make use of the C++ exceptions, the
:kconfig:option:`CONFIG_EXCEPTIONS` must be selected in the application
configuration file.
Zephyr C++ Subsystem
********************
Zephyr Minimal C++ Library
**************************
Zephyr C++ subsystem (:file:`subsys/cpp`) provides a minimal subset of the C++
standard library and application binary interface (ABI) functions to enable
basic C++ language support. This includes:
Zephyr minimal C++ library (:file:`lib/cpp/minimal`) provides a minimal subset
of the C++ standard library and application binary interface (ABI) functions to
enable basic C++ language support. This includes:
* ``new`` and ``delete`` operators
* virtual function stub and vtables
* static global initializers for global constructors
The scope of the C++ subsystem is strictly limited to providing the basic C++
language support, and it does not implement any `Standard Template Library
The scope of the minimal C++ library is strictly limited to providing the basic
C++ language support, and it does not implement any `Standard Template Library
(STL)`_ classes and functions. For this reason, it is only suitable for use in
the applications that implement their own (non-standard) class library and do
rely on the Standard Template Library (STL) components.

View File

@ -4,6 +4,7 @@ if(NOT CONFIG_EXTERNAL_LIBC)
add_subdirectory(libc)
add_subdirectory(posix)
endif()
add_subdirectory_ifdef(CONFIG_CPLUSPLUS cpp)
add_subdirectory(os)
add_subdirectory(util)
add_subdirectory_ifdef(CONFIG_SMF smf)

View File

@ -3,6 +3,8 @@
source "lib/libc/Kconfig"
source "lib/cpp/Kconfig"
menu "Additional libraries"
source "lib/os/Kconfig"

View File

@ -6,7 +6,6 @@ add_subdirectory_ifdef(CONFIG_LORAWAN lorawan)
add_subdirectory_ifdef(CONFIG_BT bluetooth)
add_subdirectory_ifdef(CONFIG_CONSOLE_SUBSYS console)
add_subdirectory_ifdef(CONFIG_SHELL shell)
add_subdirectory_ifdef(CONFIG_CPLUSPLUS cpp)
add_subdirectory_ifdef(CONFIG_DISK_ACCESS disk)
add_subdirectory_ifdef(CONFIG_EMUL emul)
add_subdirectory(fs)

View File

@ -12,8 +12,6 @@ source "subsys/canbus/Kconfig"
source "subsys/console/Kconfig"
source "subsys/cpp/Kconfig"
source "subsys/debug/Kconfig"
source "subsys/disk/Kconfig"