Quang Thinh Ha
Quang Thinh Ha

Reputation: 241

Compiling Qt5 on MacOS with gcc-8 instead of clang

I'm trying to compile Qt5 on MacOS, using gcc-8 instead of the default clang. From this guide here I have been able to do a configure using:

CC=gcc-8 CXX=g++-8 CFORT=gfortran-8 ../configure --prefix=/Users/qth20/Utilities/qt-5.12 -opensource -nomake examples -nomake tests -platform g++-8

But when I check the verbose output:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -pipe -g -fPIC -std=gnu11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.12 -fvisibility=hidden -w -fno-exceptions -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DPNG_ARM_NEON_OPT=0 -DPNG_POWERPC_VSX_OPT=0 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -isystem /Users/qth20/qt5/qtbase/src/3rdparty/libpng -I. -isystem /Users/qth20/qt5/qtbase/src/3rdparty/libpng -I/Users/qth20/qt5/qtbase/mkspecs/macx-clang -o .obj/debug/pngmem.o /Users/qth20/qt5/qtbase/src/3rdparty/libpng/pngmem.c

It seems to be still using clang instead of gcc-8. Any suggestions to get around this?

Upvotes: 1

Views: 459

Answers (1)

Allan Jensen
Allan Jensen

Reputation: 564

Just use the macos-g++ platform: ../configure -platform macos-g++

No guarantees that everything builds out of the box though.

Upvotes: 2

Related Questions