Commit d32ad623 authored by Jamie McCrae's avatar Jamie McCrae Committed by Fabio Baltieri
Browse files

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: default avatarJamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit f4cfb8cd)
parent 1424b494
Loading
Loading
Loading
Loading
+4 −0
Changes for cmake/modules/extensions.cmake: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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)