Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to disable Zephyrs C++ implementation #18464

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions subsys/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_sources_ifdef(CONFIG_CPLUSPLUS
cpp_virtual.c
cpp_vtable.cpp
zephyr_sources(
cpp_init_array.c
cpp_ctors.c
cpp_dtors.c
)

if (NOT CONFIG_LIB_CPLUSPLUS OR CONFIG_ZEPHYR_CPLUSPLUS)
SebastianBoe marked this conversation as resolved.
Show resolved Hide resolved
zephyr_sources(
cpp_virtual.c
cpp_vtable.cpp
cpp_new.cpp
)
endif()
10 changes: 10 additions & 0 deletions subsys/cpp/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,14 @@ config RTTI
help
This option enables support of C++ RTTI.

if LIB_CPLUSPLUS

config ZEPHYR_CPLUSPLUS
bool "Use Zephyr C++ Implementation"
help
Use Zephyr implementation for operator new, delete, pure virtual
functions and vtables.

endif #LIB_CPLUSPLUS

endif # CPLUSPLUS
11 changes: 9 additions & 2 deletions tests/application_development/libcxx/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ tests:
misc.app_dev.libcxx:
arch_exclude: posix
platform_exclude: qemu_x86_coverage
min_flash: 54
tags: cpp
misc.app_dev.libcxx.zephyr_cpp:
arch_exclude: posix
platform_exclude: qemu_x86_coverage
tags: cpp
extra_configs:
- CONFIG_ZEPHYR_CPLUSPLUS=y
misc.app_dev.libcxx.exceptions:
arch_exclude: posix
platform_exclude: qemu_x86_coverage 96b_meerkat96
colibri_imx7d_m4 warp7_m4 pico_pi_m4 qemu_x86_64
platform_exclude: qemu_x86_coverage
min_flash: 54
tags: cpp
extra_configs:
- CONFIG_EXCEPTIONS=y