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 @@ -135,6 +135,12 @@ else()
135
135
set (_local_TOOLCHAIN_HAS_PICOLIBC n )
136
136
endif ()
137
137
138
+ if (TOOLCHAIN_HAS_GLIBCXX )
139
+ set (_local_TOOLCHAIN_HAS_GLIBCXX y )
140
+ else ()
141
+ set (_local_TOOLCHAIN_HAS_GLIBCXX n )
142
+ endif ()
143
+
138
144
# APP_DIR: Path to the main image (sysbuild) or synonym for APPLICATION_SOURCE_DIR (non-sysbuild)
139
145
zephyr_get (APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR )
140
146
@@ -159,6 +165,7 @@ set(COMMON_KCONFIG_ENV_SETTINGS
159
165
TOOLCHAIN_KCONFIG_DIR=${TOOLCHAIN_KCONFIG_DIR}
160
166
TOOLCHAIN_HAS_NEWLIB=${_local_TOOLCHAIN_HAS_NEWLIB}
161
167
TOOLCHAIN_HAS_PICOLIBC=${_local_TOOLCHAIN_HAS_PICOLIBC}
168
+ TOOLCHAIN_HAS_GLIBCXX=${_local_TOOLCHAIN_HAS_GLIBCXX}
162
169
EDT_PICKLE=${EDT_PICKLE}
163
170
# Export all Zephyr modules to Kconfig
164
171
${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 @@ -96,7 +96,7 @@ choice LIBCPP_IMPLEMENTATION
96
96
prompt "C++ Standard Library Implementation"
97
97
default EXTERNAL_LIBCPP if REQUIRES_FULL_LIBCPP && NATIVE_BUILD
98
98
default LIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP && "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm"
99
- default GLIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP
99
+ default GLIBCXX_LIBCPP if REQUIRES_FULL_LIBCPP && "$(TOOLCHAIN_HAS_GLIBCXX)" = "y"
100
100
default MINIMAL_LIBCPP
101
101
102
102
config MINIMAL_LIBCPP
@@ -111,6 +111,7 @@ config MINIMAL_LIBCPP
111
111
112
112
config GLIBCXX_LIBCPP
113
113
bool "GNU C++ Standard Library"
114
+ depends on "$(TOOLCHAIN_HAS_GLIBCXX)" = "y"
114
115
depends on NEWLIB_LIBC || PICOLIBC
115
116
select FULL_LIBCPP_SUPPORTED
116
117
help
You can’t perform that action at this time.
0 commit comments