On 2015/10/17 11:57, Caspar Schutijser wrote: > Hi ports@, > > I ran into the following issue regarding Qt 5 and C++11. > > /usr/local/lib/qt5/mkspecs/openbsd-g++/qmake.conf from the qt-5 port > contains the following lines: > 22 QMAKE_CXX = g++ > ... > 24 QMAKE_CXXFLAGS_CXX11 = -std=c++11 > > So when we try to compile C++11 code, qmake-qt5 tries to pass -std=c++11 > to g++, which results in the following error: > c11plus: error: unrecognized command line option "-std=c++11" > > Of course, g++ in base does not support C++11. So how are we going > to compile C++11 code now? > > One possibility would be to put QMAKE_CXX = eg++ in qmake.conf, which > would result in a RUN_DEPENDS on g++ in ports, I think. I verified that > it works. One disadvantage of this is that people who just use Qt 5 to > run programs (rather than compiling programs) also will have g++ from > ports installed. > > What do you think? > > Best regards, > Caspar Schutijser >
We definitely don't want a run dependency on eg++ for the Qt5 package. This is mostly setup for doing builds as part of ports. And in that case, if you're writing a port which uses Qt5, you would set MODULES=x11/qt5 which automatically inserts a link or wrapper for the correct compiler at the head of the path so that calling it as 'g++' works.