Skip to content

Commit f34209c

Browse files
keith-packardnashif
authored andcommitted
cmake: Check for zephyr-gnu when force -O2 for C++ exceptions
If the application is using exceptions, we need to use SPEED_OPTIMIZATIONS to get the libstdc++ version with exception support. Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent eaa1f17 commit f34209c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/zephyr/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ config PICOLIBC_DEFAULT
2525
Zephyr SDK >=0.17.1 always uses Picolibc
2626

2727
choice COMPILER_OPTIMIZATIONS
28-
default SPEED_OPTIMIZATIONS if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" && CPP_EXCEPTIONS
28+
default SPEED_OPTIMIZATIONS if ("$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" || "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr-gnu") && CPP_EXCEPTIONS
2929
endchoice

0 commit comments

Comments
 (0)