Fix C++ standard: use zephyr_library to override Zephyr's -std=c++11 with gnu++23

This commit is contained in:
afiqzudinhadi 2026-06-22 22:30:31 +08:00
parent d1b91ba144
commit 7fdf6823f5

View file

@ -179,14 +179,23 @@ if(CONFIG_ZMK_JAVELIN_STENO)
${ZMK_INIT_SRC} ${ZMK_INIT_SRC}
) )
# C++ flags + Javelin compile definitions # Build Javelin as a separate static library so we can control
set_source_files_properties(${ALL_CXX_SRC} PROPERTIES # C++ standard without Zephyr's -std=c++11 interfering.
COMPILE_FLAGS "-std=gnu++23 -fno-exceptions -fno-rtti -fno-threadsafe-statics" zephyr_library_named(javelin_steno)
COMPILE_DEFINITIONS "JAVELIN_USE_EMBEDDED_STENO=1;JAVELIN_USE_USER_DICTIONARY=1;JAVELIN_PLATFORM_ZEPHYR=1" zephyr_library_sources(${ALL_CXX_SRC})
zephyr_library_compile_options(
-std=gnu++23
-fno-exceptions
-fno-rtti
-fno-threadsafe-statics
)
zephyr_library_compile_definitions(
JAVELIN_USE_EMBEDDED_STENO=1
JAVELIN_USE_USER_DICTIONARY=1
JAVELIN_PLATFORM_ZEPHYR=1
) )
target_sources(app PRIVATE target_sources(app PRIVATE
${ALL_CXX_SRC}
${ZMK_BEHAVIOR_SRC} ${ZMK_BEHAVIOR_SRC}
) )