sysbuild: Use UTF-8 encoding for cache

Fixes an issue whereby strings are placed in UTF-8 format but the
application doesn't read them in when configured using sysbuild
and another issue whereby sysbuild then reads the application's
cache and did not treat them as UTF-8

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2024-06-12 12:15:52 +01:00 committed by Anas Nashif
commit 4fcde701ec
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ include_guard(GLOBAL)
if(SYSBUILD)
add_custom_target(sysbuild_cache)
file(STRINGS "${SYSBUILD_CACHE}" sysbuild_cache_strings)
file(STRINGS "${SYSBUILD_CACHE}" sysbuild_cache_strings ENCODING UTF-8)
foreach(str ${sysbuild_cache_strings})
# Using a regex for matching whole 'VAR_NAME:TYPE=VALUE' will strip semi-colons
# thus resulting in lists to become strings.

View file

@ -20,7 +20,7 @@ function(load_cache)
if(NOT TARGET ${LOAD_CACHE_IMAGE}_cache)
add_custom_target(${LOAD_CACHE_IMAGE}_cache)
endif()
file(STRINGS "${LOAD_CACHE_BINARY_DIR}/CMakeCache.txt" cache_strings)
file(STRINGS "${LOAD_CACHE_BINARY_DIR}/CMakeCache.txt" cache_strings ENCODING UTF-8)
foreach(str ${cache_strings})
# Using a regex for matching whole 'VAR_NAME:TYPE=VALUE' will strip semi-colons
# thus resulting in lists to become strings.