Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(zephyr): global CSTD property is deprecated #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ports/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ config MEMFAULT_REBOOT_REASON_CUSTOM_ENABLE
config MEMFAULT_COMPACT_LOG
bool "Enable compact logging"
default n
select REQUIRES_STD_C11
select GNU_C_EXTENSIONS
help
When enabled, the Memfault SDK will use a compact representation
for log messages written using the 'MEMFAULT_LOG_x' macros. Find more
Expand Down
5 changes: 4 additions & 1 deletion ports/zephyr/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ if (CONFIG_MEMFAULT_COMPACT_LOG)
zephyr_linker_sources(SECTIONS memfault-compact-log.ld)
# Compact logs requires a minimum C standard of gnu11, due to use of GNU
# extensions and C11 features.
set_property(GLOBAL PROPERTY CSTD gnu11)
# Use global property CSTD if not already set by Zephyr config.
if (NOT (CONFIG_REQUIRES_STD_C11 AND CONFIG_GNU_C_EXTENSIONS))
set_property(GLOBAL PROPERTY CSTD gnu11)
endif()
endif()

if(CONFIG_MEMFAULT_HEAP_STATS AND CONFIG_HEAP_MEM_POOL_SIZE GREATER 0)
Expand Down