[Qt-creator] Bundling clang (for code model) with qt-creator package

Nikolai Kosjar nikolai.kosjar at qt.io
Mon Aug 29 08:40:05 CEST 2016


Hi!

On 08/28/2016 03:05 AM, Andrzej Telszewski wrote:
> Hi,
>
> As mentioned here:
> https://blog.qt.io/blog/2016/08/25/qt-creator-4-1-0-released/ it might
> be valuable to use clang 3.8.1 with Qt Creator 4.1.0.
>
> But my system's llvm package is at version 3.8.0 and will stay like that
> for quite some time.

Note that there is hardly any difference between llvm 3.8.0 and 3.8.1 
when it comes to the clang code model. The changes between 3.8.0 and 
3.8.1 look all backend-specific, but we use only the frontend.

For some reason the mentioned patch in the blog post is not part of the 
official 3.8.1 release, but of our shipped build.

> As I don't want to update the system's llvm, I would like to package
> version 3.8.1 of llvm together with qt-creator, for the purpose of Code
> Model (is there anything else internal to Qt Creator that uses llvm?).

The Clang Static Analyzer plugin needs the clang executable + the 
intrinsics headers (currently installed, e.g. for Linux at 
${QTCREATOR_INSTALL_ROOT}/share/qtcreator/cplusplus/clang/3.8.1/include).

> I see two solutions:
> 1. Create separate package for llvm, something like "qt-creator-llvm"
> that installs under non-system wide directory and then, when building Qt
> Creator, adjust LLVM_INSTALL_DIR to point to that directory.
> 2. Create single package containing both llvm and Qt Creator.
>
> Solution 1) is straightforward, in that I can first build and install
> qt-creator-llvm and then build and install qt-creator.
>
> Solution 2) requires that I can somehow point the qt-creator
> LLVM_INSTALL_DIR to the temporary directory where the llvm has been
> installed for the purpose of packaging. But once the packaging has been
> finished, LLVM_INSTALL_DIR has to point to a different directory,
> relative to the package installation directory and not package creation
> directory.
>
> I would much preferred the second solution.
> So the question is: is it possible?

I'm not sure I understand the requirements needed for this, but we do 
this is already for our official packages.

Build Qt Creator with LLVM_INSTALL_DIR set and install it (see link 
below). The relevant parts of the LLVM_INSTALL_DIR will be copied over 
to Qt Creator's installation directory (+ adapting the rpath etc.).

 
http://wiki.qt.io/Building_Qt_Creator_from_Git#Installing_Qt_Creator_.28optional.29


Nikolai




More information about the Qt-creator mailing list