cmake: add_llext_target: handle empty LLEXT_REMOVE_FLAGS

When LLEXT_REMOVE_FLAGS is empty, the regular expression that is
constructed to remove flags from the Zephyr flags would match any
string, resulting in all flags being removed. This is not the intended
behavior, so we need to handle this case by setting the regular
expression to a pattern that does not match anything.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake
index 35fa6b3..35711a2 100644
--- a/cmake/modules/extensions.cmake
+++ b/cmake/modules/extensions.cmake
@@ -5302,6 +5302,11 @@
        OUTPUT_VARIABLE llext_remove_flags_regexp
   )
   string(REPLACE ";" "|" 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
+    set(llext_remove_flags_regexp "^$")
+  endif()
   set(zephyr_flags
       "$<TARGET_PROPERTY:zephyr_interface,INTERFACE_COMPILE_OPTIONS>"
   )