Browse Source

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>
pull/74227/head
Jamie McCrae 1 year ago committed by Anas Nashif
parent
commit
4fcde701ec
  1. 2
      cmake/modules/basic_settings.cmake
  2. 2
      share/sysbuild/cmake/modules/sysbuild_extensions.cmake

2
cmake/modules/basic_settings.cmake

@ -23,7 +23,7 @@ include_guard(GLOBAL) @@ -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.

2
share/sysbuild/cmake/modules/sysbuild_extensions.cmake

@ -20,7 +20,7 @@ function(load_cache) @@ -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.

Loading…
Cancel
Save