cmake/modules/extensions: Fix string list replacement

Changing from `;` to `|` directly doesn't consider for escaped `;`
inside a list. Fix suggested by @pillo79.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
This commit is contained in:
Ederson de Souza 2024-05-07 15:45:12 -07:00 committed by Anas Nashif
commit 2b53c83058

View file

@ -5326,7 +5326,7 @@ function(add_llext_target target_name)
REPLACE "(.+)" "^\\1$"
OUTPUT_VARIABLE llext_remove_flags_regexp
)
string(REPLACE ";" "|" llext_remove_flags_regexp "${llext_remove_flags_regexp}")
list(JOIN llext_remove_flags_regexp "|" llext_remove_flags_regexp)
if ("${llext_remove_flags_regexp}" STREQUAL "")
# an empty regexp would match anything, we actually need the opposite
# so set it to match empty strings