From 956a50bb7d18fae82e95d96b4072e90b955c88a2 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Sun, 20 Jul 2025 14:10:28 +0800 Subject: [PATCH] cmake(bugfix):add missing c++ toolchain search path when libcxx or uClib++ is not selected, we use the default NUTTX cxx Signed-off-by: xuxin19 --- arch/arm/src/cmake/gcc.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/cmake/gcc.cmake b/arch/arm/src/cmake/gcc.cmake index ea2a03098b..fa253d2400 100644 --- a/arch/arm/src/cmake/gcc.cmake +++ b/arch/arm/src/cmake/gcc.cmake @@ -247,10 +247,8 @@ if(CONFIG_BUILD_PIC) add_link_options(-Wl,--emit-relocs) endif() -add_compile_options( - -Wno-attributes -Wno-unknown-pragmas - $<$:-Wstrict-prototypes> - $<$:-nostdinc++>) +add_compile_options(-Wno-attributes -Wno-unknown-pragmas + $<$:-Wstrict-prototypes>) # When all C++ code is built using GCC 7.1 or a higher version, we can safely # disregard warnings of the type "parameter passing for X changed in GCC 7.1." @@ -259,6 +257,10 @@ add_compile_options( add_compile_options(-Wno-psabi) +if(NOT CONFIG_LIBCXXTOOLCHAIN) + add_compile_options($<$:-nostdinc++>) +endif() + if(CONFIG_CXX_STANDARD) add_compile_options($<$:-std=${CONFIG_CXX_STANDARD}>) endif()