How to set C++ compiler outside Macports?

Ian Wadham iandw.au at gmail.com
Tue Jul 31 20:03:32 PDT 2012


On 30/07/2012, at 2:54 AM, Ryan Schmidt wrote:
> Probably the usual CC and CXX environment variables could be used to influence that.

Thanks, Ryan.  I have set those up in my CMake script now.

>> Is use of clang now official Macports policy?  Last I heard on this list, a
>> few months back, its use was experimental.
> 
> The compiler MacPorts uses by default is chosen based on the Xcode version.
> 
> Xcode 2.x: gcc-4.0
> Xcode 3.x: gcc-4.2
> Xcode 4.0 and 4.1: llvm-gcc-4.2
> Xcode 4.2 and up: clang

Thanks again, Ryan.  I have passed that information on to the KDE developers.

It turns out that the KDE project is intending to move to clang in the future but is
not ready for it yet.  Its build macros do not generate the right settings of clang.

It is OK to build KDE modules with clang, but if you build one that way you must build
the lot with clang.  I was not building my own code with clang, hence my problems.

When clang is used to build KDE modules, many more symbols than necessary
are exported.  That is harmless, but will lead to larger object files than necessary.

Please would you close https://trac.macports.org/ticket/34605 now (I do not seem
to have the right access).

I have included there a summary and a link to the details of what the KDE build-system
developer had to say.  I hope the KDE port guys will have a look.

All the best, Ian W.



More information about the macports-users mailing list