Skip to content

Commit

Permalink
lib: cpp: Relocate subsys/cpp to lib/cpp
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stephanosio authored and cfriedt committed Jan 13, 2023
1 parent 9d2fe69 commit feaab27
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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++"

Expand Down
14 changes: 7 additions & 7 deletions doc/develop/languages/cpp/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

source "lib/libc/Kconfig"

source "lib/cpp/Kconfig"

menu "Additional libraries"

source "lib/os/Kconfig"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion subsys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions subsys/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ source "subsys/canbus/Kconfig"

source "subsys/console/Kconfig"

source "subsys/cpp/Kconfig"

source "subsys/debug/Kconfig"

source "subsys/disk/Kconfig"
Expand Down

0 comments on commit feaab27

Please sign in to comment.