[PATCH] D59632: [llvm] [cmake] Add additional headers only if they exist

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 23:31:17 PDT 2019


mgorny marked an inline comment as done.
mgorny added inline comments.


================
Comment at: llvm/cmake/modules/LLVMProcessSources.cmake:35
+  foreach(file ${hds})
+    if(EXISTS ${file})
+      list(APPEND filtered ${file})
----------------
smeenai wrote:
> smeenai wrote:
> > mgorny wrote:
> > > smeenai wrote:
> > > > I'd add a comment explaining this is for broken symlinks, otherwise I'd be wondering why you were checking for the existence of a file you just globbed...
> > > > 
> > > > Actually, is `EXISTS` resolving symlinks documented anywhere? It's unclear if it would return the existence of the symlink itself or the target of the symlink.
> > > > I'd add a comment explaining this is for broken symlinks, otherwise I'd be wondering why you were checking for the existence of a file you just globbed...
> > > 
> > > Good idea.
> > > 
> > > > Actually, is EXISTS resolving symlinks documented anywhere? It's unclear if it would return the existence of the symlink itself or the target of the symlink.
> > > 
> > > To be honest, I don't see it in CMake docs. I think I presumed that behavior from shell's `-f` operator but there's indeed some potential ambiguity here.
> > Looks like it just calls `access`, which should resolve symlinks.
> I submitted https://gitlab.kitware.com/cmake/cmake/merge_requests/3189 to CMake to clarify this.
Thank you. I'll add the comment later today and push it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59632/new/

https://reviews.llvm.org/D59632





More information about the llvm-commits mailing list