From 687a64222b4c87c825258d4dfeb1f0794e8cb300 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 11 Jun 2019 18:16:27 +0000 Subject: Vendor import of llvm release_80 branch r363030: https://llvm.org/svn/llvm-project/llvm/branches/release_80@363030 --- cmake/modules/AddLLVM.cmake | 1 + cmake/modules/LLVMProcessSources.cmake | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'cmake/modules') diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 0df6845aaa71d..1a417447278b8 100755 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -855,6 +855,7 @@ if(NOT LLVM_TOOLCHAIN_TOOLS) llvm-lib llvm-objdump llvm-rc + llvm-profdata ) endif() diff --git a/cmake/modules/LLVMProcessSources.cmake b/cmake/modules/LLVMProcessSources.cmake index 7cbd2863500cf..d0be0e8b3ba3d 100644 --- a/cmake/modules/LLVMProcessSources.cmake +++ b/cmake/modules/LLVMProcessSources.cmake @@ -30,7 +30,15 @@ endmacro(add_td_sources) function(add_header_files_for_glob hdrs_out glob) file(GLOB hds ${glob}) - set(${hdrs_out} ${hds} PARENT_SCOPE) + set(filtered) + foreach(file ${hds}) + # Explicit existence check is necessary to filter dangling symlinks + # out. See https://bugs.gentoo.org/674662. + if(EXISTS ${file}) + list(APPEND filtered ${file}) + endif() + endforeach() + set(${hdrs_out} ${filtered} PARENT_SCOPE) endfunction(add_header_files_for_glob) function(find_all_header_files hdrs_out additional_headerdirs) -- cgit v1.2.3