[CMake] Intel Compilers and libc++?

Ben Pope benpope81 at gmail.com
Sun Apr 5 00:41:50 EDT 2015


On Sunday, April 05, 2015 08:30 AM, digitalriptide wrote:
> I have an Ubuntu installation with both libstdc++ and libc++
> installed, and I am using Intel's C++ compiler. By default, CMake is
> picking up and linking against libstdc++. Is there a way to ask CMake
> to prefer libc++ over libstdc++, when available?

I'm not aware of a way to tell CMake directly, but from what I can 
gather, you can ask the compiler to prefer libc++ by passing 
"-stdlib=libc++" to it.

CMAKE_CXX_FLAGS is the easiest the place for that.  You may need to add 
it to linker flags as well, if you link as a separate step.

Ben



More information about the CMake mailing list