Skip to content

Commit 2eb1315

Browse files
tejlmandcfriedt
authored andcommitted
cmake: kconfig: use absolute files for merge_config_files
The `merge_config_files` list contains files with both relative and absolute paths. Each entry is checked and files with a relative path are converted to absolute path. This creates a `merge_config_files_with_absolute_paths` identical to the `merge_config_files` but with absolute path on each entry. Afterwards it is mixed whether `merge_config_files` or `merge_config_files_with_absolute_paths` are used creating unnecessary risk when the list with relative path files are used. This commit sets the content of `merge_config_files` with updated absolute paths files, and also updates all places to use this list. This ensures that after path conversion then only the list with absolute paths is used. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 2825481 commit 2eb1315

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmake/kconfig.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,9 @@ foreach(f ${merge_config_files})
204204

205205
list(APPEND merge_config_files_with_absolute_paths ${path})
206206
endforeach()
207+
set(merge_config_files ${merge_config_files_with_absolute_paths})
207208

208-
foreach(f ${merge_config_files_with_absolute_paths})
209+
foreach(f ${merge_config_files})
209210
if(NOT EXISTS ${f} OR IS_DIRECTORY ${f})
210211
message(FATAL_ERROR "File not found: ${f}")
211212
endif()
@@ -214,7 +215,7 @@ endforeach()
214215
# Calculate a checksum of merge_config_files to determine if we need
215216
# to re-generate .config
216217
set(merge_config_files_checksum "")
217-
foreach(f ${merge_config_files_with_absolute_paths})
218+
foreach(f ${merge_config_files})
218219
file(MD5 ${f} checksum)
219220
set(merge_config_files_checksum "${merge_config_files_checksum}${checksum}")
220221
endforeach()

0 commit comments

Comments
 (0)