From a9b35f0c41bb39d58ab90670844a3790b1eb9331 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Tue, 17 Jan 2023 01:53:59 +0900 Subject: [PATCH] cpp: Fix toolchain C++ standard library linkage 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 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbe0c457983..f0583b80dda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()