<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Paweł,<div class=""><br class=""></div><div class="">In general I would strongly recommend against using pre-built packages for development and distribution if you’re supporting multiple platforms. Those mechanisms are great if you’re only supporting one platform, but as you noticed the package managers across different platforms are never in sync, so using pre-built packages introduces a lot of extra burden on you.</div><div class=""><br class=""></div><div class="">There are really two options I would recommend. Which one you use depends on the relationship between your project and LLVM.</div><div class=""><br class=""></div><div class="">If your project is an LLVM or Clang based tool, the simplest solution is probably to structure your project similar to other LLVM tools and drop your source directory into the LLVM tree under “tools”. This will allow the LLVM build system to configure and build your tool with LLVM. This mechanism is widely used for projects like Clang and Polly.</div><div class=""><br class=""></div><div class="">The other approach that is a bit less traveled would be using CMake’s ExternalProject module as you mentioned. The ExternalProject module will allow you to manage the SCM checkout, configuration, build and installation of the LLVM libraries from within your project’s build system. Using ExternalProject is probably not suitable if your tool depends on more than just the LLVM project, so if you’re using Clang libraries as well as LLVM libraries you may not want to follow this approach.</div><div class=""><br class=""></div><div class="">Hope this helps,</div><div class="">-Chris</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 15, 2016, at 3:22 AM, Paweł Bylica via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello LLVM,<div class=""><br class=""></div><div class="">I'm maintaining a project that has the LLVM as a dependency. I tried using pre-built LLVM libraries as much as possible, but have issues with this approach all the time. I would like to discuss alternatives.</div><div class=""><br class=""></div><div class="">On Linux I try to use llvm-dev packages. Main issues are: different distributions has LLVM packaged differently, the packages are sometimes broken (usually cmake shared files), if not broken at the moment they can brake in the future despite the fact the particular LLVM version has been released long time ago, <a href="http://llvm.org/apt" class="">llvm.org/apt</a> has been closed.</div><div class=""><br class=""></div><div class="">On macOS I use homebrew. Usually fine but you have to wait long time for a new version (e.g. they rejected LLVM 3.7.0 for some reason). If I'm not wrong, homebrew builds LLVM from source.</div><div class=""><br class=""></div><div class="">On Windows... I build it myself and upload binaries to GitHub. Then cmake script can download it.</div><div class=""><br class=""></div><div class="">I really started thinking about building LLVM from source everywhere as a my project build step. It should work more/less the same on all platforms. In the future I might reach for LTO+PGO (I imagine it is not possible using pre-built libraries).</div><div class=""><br class=""></div><div class="">Ideally would be to setup the dependencies against the LLVM libraries during cmake configuration step and build only required libraries when building my project.</div><div class=""><br class=""></div><div class="">Recently, I've seen cmake's ExternalProject module (<a href="https://cmake.org/cmake/help/v3.5/module/ExternalProject.html" class="">https://cmake.org/cmake/help/v3.5/module/ExternalProject.html</a>) mentioned here. Can this help with my goal?</div><div class=""><br class=""></div><div class="">Have you tried something similar? What your opinions? Any suggestions?</div><div class=""><br class=""></div><div class="">- Paweł</div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>