[LLVMdev] compiler-rt CMake build

Jean-Daniel Dupas devlists at shadowlab.org
Thu Feb 6 07:57:59 PST 2014


Le 6 févr. 2014 à 16:20, Brad King <brad.king at kitware.com> a écrit :

> On 02/06/2014 08:12 AM, Alexey Samsonov wrote:
>> Please note that it makes a lot of sense to built compiler-rt (and sanitizers) with just-built
>> Clang. In fact, even though we should support building it with another compilers (gcc, MSVC),
>> using just-built-Clang should be a default scenario, like it is in configure+make build.
> 
> This is possible with CMake using the ExternalProject module:
> 
> http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:ExternalProject
> 
> The add_llvm_external_project macro already in LLVM could be taught
> to call ExternalProject_Add instead of add_subdirectory.  This could
> create a custom target with dependencies appropriately configured to
> build after Clang.  The custom target would run CMake to configure the
> project like an outside build and then launch the build.
> 
> IIUC there is a desire for Clang to be able to be built externally to
> LLVM rather than subsumed into its build process.  The top-level
> CMakeLists.txt file of Clang already has code to do that, though it
> can be much cleaner after my patches to LLVM to provide LLVMConfig.cmake
> are integrated.  Then it will even be possible to build Clang using
> CMake against a LLVM that was built and installed using configure+make.
> 
> If one would like to drive compiler-rt as part of testing a Clang built
> outside of LLVM then the appropriate place for the ExternalProject_Add
> call would be inside the build of Clang.

Look like what we need to build compiler-rt. Actually the makefile responsible to launch the compiler-rt build is in clang/runtime/compiler-rt.
Using ExternalProject_Add, we can probably add the CMake part beside that existing file, so everything will be at the same place.

> Either way, from a quick glance at the top-level CMakeLists.txt file
> in compiler-rt it appears to want to know a bunch of information about
> Clang rather than LLVM.  In this case having Clang export enough info
> for applications to write find_package(Clang) would make sense.  This
> is possible to do an can be implemented using techniques similar to
> that in my proposed LLVMConfig.cmake patch series.
> 
> -Brad
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-- Jean-Daniel








More information about the llvm-dev mailing list