Skip to content

Commit 388717e

Browse files
nordicjmhenrikbrixandersen
authored andcommitted
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 <[email protected]> (cherry picked from commit f4cfb8c)
1 parent 6866bbb commit 388717e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/modules/extensions.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,6 +2220,10 @@ function(toolchain_parse_make_rule input_file include_files)
22202220
# the element separator, so let's get the pure `;` back.
22212221
string(REPLACE "\;" ";" input_as_list ${input})
22222222

2223+
# The file might also contain multiple files on one line if one or both of
2224+
# the file paths are short, split these up into multiple elements using regex
2225+
string(REGEX REPLACE "([^ ])[ ]([^ ])" "\\1;\\2" input_as_list "${input_as_list}")
2226+
22232227
# Pop the first line and treat it specially
22242228
list(POP_FRONT input_as_list first_input_line)
22252229
string(FIND ${first_input_line} ": " index)

0 commit comments

Comments
 (0)