[llvm-dev] LLVM/CMake: in-source-tree and out-of-source tree CMake configs for the same project.

Chris Bieneman via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 20 16:19:52 PST 2017

The problem with this article is that it makes it seem like you really should choose one or the other, and that is just not so.

At this point I believe all of the LLVM sub-projects support both in-tree and out-of-tree builds with LLVM. Using the LLVM CMake packages that are installed as part of most LLVM distributions you can write your CMake scripts as if they are for in-source builds, and supporting out-of-source is a minimal effort.

To see how that works in practice please take a look at Clang's root CMakeLists.txt. Near the top there is a comment about standalone build support, and the required code is underneath. You'll find similarly CMake code in all the LLVM sub-projects which we use to support building each project separately.


> On Feb 18, 2017, at 1:37 PM, Stanislav Pankevich via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> Hello,
> Does anyone have a positive experience of maintaining CMake configs for both in-source and out-of-source kinds of hosting in the same project?
> P.S. http://stanislaw.github.io/2017/02/18/llvm-in-source-vs-out-of-source.html <http://stanislaw.github.io/2017/02/18/llvm-in-source-vs-out-of-source.html>.
> Thanks,
> Stanislav
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170220/2bf2b051/attachment.html>

More information about the llvm-dev mailing list