File tree Expand file tree Collapse file tree 6 files changed +17
-2
lines changed
Expand file tree Collapse file tree 6 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,12 @@ else()
129129 set (_local_TOOLCHAIN_HAS_PICOLIBC n)
130130endif ()
131131
132+ if (TOOLCHAIN_HAS_GLIBCXX)
133+ set (_local_TOOLCHAIN_HAS_GLIBCXX y)
134+ else ()
135+ set (_local_TOOLCHAIN_HAS_GLIBCXX n)
136+ endif ()
137+
132138# APP_DIR: Path to the main image (sysbuild) or synonym for APPLICATION_SOURCE_DIR (non-sysbuild)
133139zephyr_get(APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR)
134140
@@ -157,6 +163,7 @@ set(COMMON_KCONFIG_ENV_SETTINGS
157163 TOOLCHAIN_KCONFIG_DIR=${TOOLCHAIN_KCONFIG_DIR}
158164 TOOLCHAIN_HAS_NEWLIB=${_local_TOOLCHAIN_HAS_NEWLIB}
159165 TOOLCHAIN_HAS_PICOLIBC=${_local_TOOLCHAIN_HAS_PICOLIBC}
166+ TOOLCHAIN_HAS_GLIBCXX=${_local_TOOLCHAIN_HAS_GLIBCXX}
160167 EDT_PICKLE=${EDT_PICKLE}
161168 # Export all Zephyr modules to Kconfig
162169 ${ZEPHYR_KCONFIG_MODULES_DIR}
Original file line number Diff line number Diff line change @@ -54,3 +54,4 @@ if(NOT CROSS_COMPILE_TARGET)
5454endif ()
5555
5656set (TOOLCHAIN_HAS_NEWLIB ON CACHE BOOL "True if toolchain supports newlib" )
57+ set (TOOLCHAIN_HAS_GLIBCXX ON CACHE BOOL "True if toolchain supports libstdc++" )
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ set(SYSROOT_TARGET arm-none-eabi)
1818
1919set (CROSS_COMPILE ${TOOLCHAIN_HOME} /bin/${CROSS_COMPILE_TARGET} -)
2020set (SYSROOT_DIR ${TOOLCHAIN_HOME} /${SYSROOT_TARGET} )
21+
2122set (TOOLCHAIN_HAS_NEWLIB ON CACHE BOOL "True if toolchain supports newlib" )
23+ set (TOOLCHAIN_HAS_GLIBCXX ON CACHE BOOL "True if toolchain supports libstdc++" )
2224
2325message (STATUS "Found toolchain: gnuarmemb (${GNUARMEMB_TOOLCHAIN_PATH} )" )
Original file line number Diff line number Diff line change @@ -5,5 +5,6 @@ set(LINKER ld)
55set (BINTOOLS host-gnu)
66
77set (TOOLCHAIN_HAS_NEWLIB OFF CACHE BOOL "True if toolchain supports newlib" )
8+ set (TOOLCHAIN_HAS_GLIBCXX ON CACHE BOOL "True if toolchain supports libstdc++" )
89
910message (STATUS "Found toolchain: host (gcc/ld)" )
Original file line number Diff line number Diff line change @@ -4,4 +4,7 @@ include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/generic.cmake)
44
55set (TOOLCHAIN_KCONFIG_DIR ${ZEPHYR_SDK_INSTALL_DIR} /cmake/zephyr)
66
7- message (STATUS "Found toolchain: zephyr ${SDK_VERSION} (${ZEPHYR_SDK_INSTALL_DIR} )" )
7+ # Zephyr SDK < 0.17.1 does not set TOOLCHAIN_HAS_GLIBCXX
8+ set (TOOLCHAIN_HAS_GLIBCXX ON CACHE BOOL "True if toolchain supports libstdc++" )
9+
10+ message (STATUS "Found toolchain: zephyr-sdk-gnu ${SDK_VERSION} (${ZEPHYR_SDK_INSTALL_DIR} )" )
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ choice LIBCPP_IMPLEMENTATION
102102 prompt "C++ Standard Library Implementation"
103103 default EXTERNAL_LIBCPP if REQUIRES_FULL_LIBCPP && NATIVE_BUILD
104104 default LIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP && "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm"
105- default GLIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP
105+ default GLIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP && "$(TOOLCHAIN_HAS_GLIBCXX)" = "y"
106106 default MINIMAL_LIBCPP
107107
108108config MINIMAL_LIBCPP
@@ -117,6 +117,7 @@ config MINIMAL_LIBCPP
117117
118118config GLIBCXX_LIBCPP
119119 bool "GNU C++ Standard Library"
120+ depends on "$(TOOLCHAIN_HAS_GLIBCXX)" = "y"
120121 depends on NEWLIB_LIBC || PICOLIBC
121122 select FULL_LIBCPP_SUPPORTED
122123 help
You can’t perform that action at this time.
0 commit comments