[Interest] How to create local mkspec for gcc5 compiler

Roland Winklmeier roland.m.winklmeier at gmail.com
Thu Mar 10 12:43:30 CET 2016


Dear list,

I'm running on openSUSE Leap which has gcc 4.8.5 as system compiler but
also offers gcc5 as parallel installation. Since I need a gcc version > 4.9
for certain C++14 features, I'm trying to use gcc5 now as build chain. The
problem is that all binaries have '-5' as suffix (gcc-5, gcc-ar-5,
gcc-nm-5, ...).

Now I would like to teach qmake/Qt Creator to use those instead of the
default ones. I thought I simply can configure this in Qt Creator, but a
configured compiler is simply ignored (
https://bugreports.qt.io/browse/QTCREATORBUG-8420).
The only other idea I have is to copy the existing linux-g++ mkspec to
linux-g++-5. But since this includes several common/*.conf, I thought
copying them all into linux-g++-5 and change the names there.

Question to the experts: is there anything more clever available? For
example would it be enough to just 'override' the compiler binary names in
the top level qmake.conf:

mkspec/linux-g++-5/qmake.conf:
+ QMAKE_COMPILER = gcc-5
+ QMAKE_CC               = gcc-5
+ QMAKE_CXX             = g++-5
+ QMAKE_AR_LTCG    = gcc-ar-5
...

that would save me from copying and editing all the common configs. Of
course I could just edit the existing config files, but I would like to
keep the theoretical change to build other projects with 4.8.5 or easily
change between compilers.

Any other ideas are welcome.

Cheers Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160310/3367af9d/attachment.html>


More information about the Interest mailing list