[lld] r220117 - Hardcode the list of ELF targets here rather than using a glob.

Tom Stellard tom at stellard.net
Tue Dec 16 11:34:53 PST 2014


On Fri, Dec 12, 2014 at 05:08:38PM -0800, Hans Wennborg wrote:
> On Fri, Oct 17, 2014 at 5:56 PM, Richard Smith
> <richard-llvm at metafoo.co.uk> wrote:
> > Author: rsmith
> > Date: Fri Oct 17 19:56:31 2014
> > New Revision: 220117
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=220117&view=rev
> > Log:
> > Hardcode the list of ELF targets here rather than using a glob.
> 
> Can we merge this to 3.5? It's needed for building lld on Windows.
> (Minus the AArch64 dir which doesn't exist on the 3.5 branch.)
> 

Yes, this LGTM.  Go ahead and merge.

-Tom

> (I'm not sure how this worked for me before; maybe I had a different
> version of CMake or something else in my environment changed.)
> 
> 
> > The code was making non-portable assumptions about the exact string returned by
> > the glob (possibly by the shell?); this is more robust and matches what is done
> > everywhere else.
> >
> > Modified:
> >     lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt
> >
> > Modified: lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt
> > URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt?rev=220117&r1=220116&r2=220117&view=diff
> > ==============================================================================
> > --- lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt (original)
> > +++ lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt Fri Oct 17 19:56:31 2014
> > @@ -18,11 +18,9 @@ target_link_libraries(lldELF ${cmake_2_8
> >
> >  include_directories(.)
> >
> > -file(GLOB all_valid_subdirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/CMakeLists.txt")
> > -
> > -foreach(dir ${all_valid_subdirs})
> > -    if(${dir} MATCHES "^([^/]*)//CMakeLists.txt")
> > -        string(REGEX REPLACE "^([^/]*)//CMakeLists.txt" "\\1" dir_trimmed ${dir})
> > -        add_subdirectory(${dir_trimmed})
> > -    endif()
> > -endforeach(dir)
> > +add_subdirectory(AArch64)
> > +add_subdirectory(Hexagon)
> > +add_subdirectory(Mips)
> > +add_subdirectory(PPC)
> > +add_subdirectory(X86)
> > +add_subdirectory(X86_64)



More information about the llvm-commits mailing list