[LLVMdev] Long-Term Support for LLVM Projects Extension to Build System?

Chandler Carruth chandlerc at google.com
Thu Jun 18 19:03:14 PDT 2015


On Thu, Jun 18, 2015 at 5:10 PM John Criswell <jtcriswel at gmail.com> wrote:

> I'm wanting to know whether the ability to "plug into" the LLVM build
> system by external projects will be maintained.  For example, SAFECode
> doesn't have its own build system; it uses LLVM's, and it does so without
> being a "patch" to the LLVM source tree.  You can put the SAFECode source
> code anywhere you like, use LLVM-style Makefiles in its source code, and
> build it.  All of the PROJ_SRC_ROOT, PROJ_OBJ_ROOT magic in the autoconf
> build system is what permits that feature to work.
>

> Do you intend to keep this functionality when you replace autoconf with
> cmake, or will all projects that want to use the LLVM build system need to
> place their source code in the LLVM source tree?
>

There is actually some support for this already in the CMake build. see
projects/CMakeLists.txt and add_llvm_external_project which specifically
allows projects to live outside of LLVM's source tree.

But this is for known sub-projects, not for arbitrary ones. I understand
that your use case is slightly different in that respect.


The use of LLVM's makefiles for completely unrelated projects being built
outside of the LLVM source tree I think is likely to "go away" but that is
because the functionality it provides is largely provided directly by CMake
already.

The CMake modules that LLVM ships with which provide the missing
functionality are easily reused in an independent CMake build by setting up
the CMake module path to include LLVM's cmake directory... But I don't
really recommend it as it seems more trouble than it is worth compared to
just using the functionality that ships with CMake.


If you're using LLVM's makefiles to build code *against the LLVM libraries*
but out of tree and not as part of an LLVM build, I don't know how this
works and don't really know what to suggest. I'm just not familiar with
that pattern.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150619/fea023a2/attachment.html>


More information about the llvm-dev mailing list