Follow-up Comment #7, bug #24942 (project freeciv):

I checked Kde Neon Developer Edition, which ships Qt 5.7 on a Ubuntu
14.04-based system. The default compiler there is GCC 5.4, which defaults to
C++98. With my patch, freeciv configures fine but build fails (in Qt) as if
std::nullptr_t == int. It works fine if I set CXXFLAGS=--std=c++11, I'll need
to investigate further.

*pkg-config*

Ubuntu's packages of Qt 4.8 has .pc files
(http://packages.ubuntu.com/precise/amd64/libqt4-dev/filelist), so I'm
confident about it being distributed on Linux.

Reading
http://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/features/qt_module.prf?h=old/5.0,
it looks like the .pc files are built for "unix" and "win32-g++" systems
(which means Linux, *BSD and Windows if Qt was compiled with g++). I don't
know the precise requirement for building on Windows.

> pkg-config for Qt should set --std=c++11 if it needs it, so it's bug there
if we need to set it separately
Qt doesn't know the compiler we use, so it can't guess the required flag. This
is where limitations of autotools and pkg-config show up, and other tools such
as cmake shine. But let's not start a flame war...

> We have macros to set flags only when used compiler supports them.
I saw libtool sets variables for C++11 and PIC, but they're not part of the
public API (as far as I can tell). As PIC didn't use a macro beforehand, there
is no regression.

*Potential problems*

- Qt >= 5.7 will be picked even if Qt < 5.7 is found earlier in pkgconfig's
path.
- QtWidgets < 5.7 and eg QtCore >= 5.7 installed. C++11 won't be used, even
though QtCore requires it. idk if Qt supports such a setup, however.
- If Qt >= 5.7 is found but the compiler doesn't support C++11, the error
message still won't be very useful.


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?24942>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to