Skip to content

Commit

Permalink
cpp: Fix toolchain C++ standard library linkage
Browse files Browse the repository at this point in the history
The build system currently links the toolchain-provided C++ standard
library even when the C++ support (`CONFIG_CPP`) is not enabled.

This commit updates the build system to link the toolchain-provided C++
standard library when the C++ support is enabled and a C++ library
implementation other than the Zephyr minimal C++ library is selected.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
  • Loading branch information
stephanosio authored and carlescufi committed Jan 17, 2023
1 parent 80f87b9 commit a9b35f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ if(NOT CONFIG_NATIVE_APPLICATION)
toolchain_ld_baremetal()
endif()

if(NOT CONFIG_MINIMAL_LIBCPP)
if(CONFIG_CPP AND NOT CONFIG_MINIMAL_LIBCPP)
# @Intent: Set linker specific flags for C++
toolchain_ld_cpp()
endif()
Expand Down

0 comments on commit a9b35f0

Please sign in to comment.