treewide: Update deprecated CONFIG_LIB_CPLUSPLUS usages

This commit updates all deprecated `CONFIG_LIB_CPLUSPLUS` usages to:

* check if the Zephyr minimal C++ library is enabled using
  `CONFIG_MINIMAL_LIBCPP` instead of relying on the
  `CONFIG_LIB_CPLUSPLUS`-based inference.

* select `CONFIG_REQUIRES_FULL_LIBCPP` when there exists a component-
  level C++ standard library dependency. This allows a component to
  declare C++ standard library dependency without designating a
  specific libray implementation.

* select the correct type of C++ standard library implementation to use
  through one of the `CONFIG_LIBCPP_IMPLEMENTATION` choices.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
This commit is contained in:
Stephanos Ioannidis 2022-12-10 03:19:58 +09:00 committed by Christopher Friedt
commit cf211aa7af
12 changed files with 10 additions and 16 deletions

View file

@ -339,7 +339,7 @@ if(NOT CONFIG_NATIVE_APPLICATION)
toolchain_ld_baremetal()
endif()
if(CONFIG_LIB_CPLUSPLUS)
if(NOT CONFIG_MINIMAL_LIBCPP)
# @Intent: Set linker specific flags for C++
toolchain_ld_cpp()
endif()
@ -1881,7 +1881,7 @@ endif()
zephyr_compile_options($<TARGET_PROPERTY:compiler,nostdinc>)
target_include_directories(zephyr_interface SYSTEM INTERFACE $<TARGET_PROPERTY:compiler,nostdinc_include>)
if(NOT CONFIG_LIB_CPLUSPLUS)
if(CONFIG_MINIMAL_LIBCPP)
zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,nostdincxx>>)
endif()