diff --git a/arch/arm/src/cmake/gcc.cmake b/arch/arm/src/cmake/gcc.cmake index ea2a03098b2..fa253d24008 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()