llvm.org GIT mirror llvm / e259a4d
[llvm] [cmake] Add additional headers only if they exist Modify the add_header_files_for_glob() function to only add files that do exist, rather than all matches of the glob. This fixes CMake error when one of the include directories (which happen to include /usr/include) contain broken symlinks. Differential Revision: https://reviews.llvm.org/D59632 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357701 91177308-0d34-0410-b5e6-96231b3b80d8 Michal Gorny 6 months ago
1 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2929
3030 function(add_header_files_for_glob hdrs_out glob)
3131 file(GLOB hds ${glob})
32 set(${hdrs_out} ${hds} PARENT_SCOPE)
32 set(filtered)
33 foreach(file ${hds})
34 # Explicit existence check is necessary to filter dangling symlinks
35 # out. See https://bugs.gentoo.org/674662.
36 if(EXISTS ${file})
37 list(APPEND filtered ${file})
38 endif()
39 endforeach()
40 set(${hdrs_out} ${filtered} PARENT_SCOPE)
3341 endfunction(add_header_files_for_glob)
3442
3543 function(find_all_header_files hdrs_out additional_headerdirs)