[libcxx] r259842 - Fix the search path for CMake files

Niels Ole Salscheider via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 15 00:25:52 PST 2016


Am Tuesday 09 February 2016, 17:06:58 schrieb Richard Smith:
> On Thu, Feb 4, 2016 at 3:17 PM, Niels Ole Salscheider via cfe-commits
> 
> <cfe-commits at lists.llvm.org> wrote:
> > Author: olesalscheider
> > Date: Thu Feb  4 17:17:20 2016
> > New Revision: 259842
> > 
> > URL: http://llvm.org/viewvc/llvm-project?rev=259842&view=rev
> > Log:
> > Fix the search path for CMake files
> > 
> > This allows to find the LLVM's CMake files after moving them in
> > r259821.
> 
> This breaks out-of-tree builds of libc++ with older versions of LLVM.
> What do you think of the attached patch? (Always look for the LLVM
> cmake modules in the source tree rather than sometimes also looking
> for them in the build tree.)

I think it might be better to try the new path and fall back to the old one if 
we want to support that case.

It seems that we can currently build libcxx without LLVM's source folder being 
around, even though it generates a warning. That would break with your patch.

> > Modified:
> >     libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
> > 
> > Modified: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
> > URL:
> > http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleOutO
> > fTreeLLVM.cmake?rev=259842&r1=259841&r2=259842&view=diff
> > =========================================================================
> > ===== --- libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake (original)
> > +++ libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake Thu Feb  4
> > 17:17:20 2016 @@ -35,7 +35,7 @@ macro(find_llvm_parts)
> > 
> >      set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to
> >      llvm/include")
> >      set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build
> >      tree")
> >      set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source
> >      tree")> 
> > -    set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
> > +    set(LLVM_CMAKE_PATH
> > "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")> 
> >    else()
> >    
> >      set(LLVM_FOUND OFF)
> >      return()
> > 
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list