Skip to content

Commit

Permalink
cmake: modules: extension: Fix dts file watch
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit f4cfb8c)
  • Loading branch information
nordicjm authored and github-actions[bot] committed Jun 25, 2024
1 parent 48ba8b4 commit 00e47ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/modules/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,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)
Expand Down

0 comments on commit 00e47ed

Please sign in to comment.