cmake: modules: extension: Fix dts file watch

Fixes an issue in the code that processes the output file of a
compiler to see which files should be watched, the compiler can
combine multiple files into a single line instead of putting them
each on separate lines if the length of the file paths is short,
therefore account for this and split it up into multiple elements

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2024-06-21 10:46:11 +01:00 committed by Anas Nashif
commit f4cfb8cd96

View file

@ -2352,6 +2352,10 @@ function(toolchain_parse_make_rule input_file include_files)
# the element separator, so let's get the pure `;` back.
string(REPLACE "\;" ";" input_as_list ${input})
# The file might also contain multiple files on one line if one or both of
# the file paths are short, split these up into multiple elements using regex
string(REGEX REPLACE "([^ ])[ ]([^ ])" "\\1;\\2" input_as_list "${input_as_list}")
# Pop the first line and treat it specially
list(POP_FRONT input_as_list first_input_line)
string(FIND ${first_input_line} ": " index)