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()
129
129
set (_local_TOOLCHAIN_HAS_PICOLIBC n)
130
130
endif ()
131
131
132
+ if (TOOLCHAIN_HAS_GLIBCXX)
133
+ set (_local_TOOLCHAIN_HAS_GLIBCXX y)
134
+ else ()
135
+ set (_local_TOOLCHAIN_HAS_GLIBCXX n)
136
+ endif ()
137
+
132
138
# APP_DIR: Path to the main image (sysbuild) or synonym for APPLICATION_SOURCE_DIR (non-sysbuild)
133
139
zephyr_get(APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR)
134
140
@@ -157,6 +163,7 @@ set(COMMON_KCONFIG_ENV_SETTINGS
157
163
TOOLCHAIN_KCONFIG_DIR=${TOOLCHAIN_KCONFIG_DIR}
158
164
TOOLCHAIN_HAS_NEWLIB=${_local_TOOLCHAIN_HAS_NEWLIB}
159
165
TOOLCHAIN_HAS_PICOLIBC=${_local_TOOLCHAIN_HAS_PICOLIBC}
166
+ TOOLCHAIN_HAS_GLIBCXX=${_local_TOOLCHAIN_HAS_GLIBCXX}
160
167
EDT_PICKLE=${EDT_PICKLE}
161
168
# Export all Zephyr modules to Kconfig
162
169
${ZEPHYR_KCONFIG_MODULES_DIR}
Original file line number Diff line number Diff line change @@ -54,3 +54,4 @@ if(NOT CROSS_COMPILE_TARGET)
54
54
endif ()
55
55
56
56
set (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)
18
18
19
19
set (CROSS_COMPILE ${TOOLCHAIN_HOME} /bin/${CROSS_COMPILE_TARGET} -)
20
20
set (SYSROOT_DIR ${TOOLCHAIN_HOME} /${SYSROOT_TARGET} )
21
+
21
22
set (TOOLCHAIN_HAS_NEWLIB ON CACHE BOOL "True if toolchain supports newlib" )
23
+ set (TOOLCHAIN_HAS_GLIBCXX ON CACHE BOOL "True if toolchain supports libstdc++" )
22
24
23
25
message (STATUS "Found toolchain: gnuarmemb (${GNUARMEMB_TOOLCHAIN_PATH} )" )
Original file line number Diff line number Diff line change @@ -5,5 +5,6 @@ set(LINKER ld)
5
5
set (BINTOOLS host-gnu)
6
6
7
7
set (TOOLCHAIN_HAS_NEWLIB OFF CACHE BOOL "True if toolchain supports newlib" )
8
+ set (TOOLCHAIN_HAS_GLIBCXX ON CACHE BOOL "True if toolchain supports libstdc++" )
8
9
9
10
message (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)
4
4
5
5
set (TOOLCHAIN_KCONFIG_DIR ${ZEPHYR_SDK_INSTALL_DIR} /cmake/zephyr)
6
6
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
102
102
prompt "C++ Standard Library Implementation"
103
103
default EXTERNAL_LIBCPP if REQUIRES_FULL_LIBCPP && NATIVE_BUILD
104
104
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"
106
106
default MINIMAL_LIBCPP
107
107
108
108
config MINIMAL_LIBCPP
@@ -117,6 +117,7 @@ config MINIMAL_LIBCPP
117
117
118
118
config GLIBCXX_LIBCPP
119
119
bool "GNU C++ Standard Library"
120
+ depends on "$(TOOLCHAIN_HAS_GLIBCXX)" = "y"
120
121
depends on NEWLIB_LIBC || PICOLIBC
121
122
select FULL_LIBCPP_SUPPORTED
122
123
help
You can’t perform that action at this time.
0 commit comments