[LLVMdev] including llvm headers in the sample project

Dan Liew dan at su-root.co.uk
Wed Jul 16 16:58:28 PDT 2014


> also, is autoconf really the best way to be building llvm projects? It seems
> like most projects use cmake instead, but I wasn't able to find llvm
> documentation for setting up a sample project with cmake.

I would say that CMake is a better choice (but I am biased as I have a
strong dislike of autoconf)

Being a CMake user that using CMake is the better choice.

Doing this is documented at [1].

Please note this documents the "old" way of using the LLVM libraries
within CMake and that there is a different way of linking against the
LLVM libraries that is nicer in LLVM3.5. But the old way should still
work at least for now. I actually just posted [3] to llvmdev about
this issue.

Here [2] is a *very* hacky example of the new way of using LLVM
libraries with CMake for LLVM 3.5. But this should give an idea of how
you can link against the LLVM libraries in your own project that uses
CMake as its build system.

[1] http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project
[2] https://github.com/delcypher/llvm-hack
[3] http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-July/074829.html


Thanks,
Dan Liew
PhD Student - Imperial College London



More information about the llvm-dev mailing list