Set CC to clang++

Joshua Root jmr at macports.org
Fri Nov 22 00:46:19 UTC 2019


On 2019-11-22 09:35 , Steven Smith wrote:
> I must set the clang compiler to clang++ or g++ to avoid some ld symbol mangling issue (see below).
> 
> What’s the right Portfile directive to do this?
> 
> Effectively, I believe that I need:
> 
> CC=/usr/bin/clang++
> 
> 
> Error on the Mac: Undefined symbols for architecture x86_64 · Issue #285 · nlohmann/json
> https://github.com/nlohmann/json/issues/285#issuecomment-348090484

Is the build system really using $CC to compile C++ code? The usual
convention is that CC is the C compiler and CXX is the C++ compiler.
Naturally using the wrong one will cause problems.

Sticking to the convention is greatly preferable, but if for some reason
you really need to name a C++ compiler in CC, this will do it:

# Yuck
configure.cc	${configure.cxx}

- Josh


More information about the macports-dev mailing list