Version info: CMake 3.0.2, XCode 5 (LLVM 5.1)
I'm building an AudioUnit and I get the infamous "std::__1..." linking problems (as when libc++&libstdc++ are used simultanously), however I set the CMAKE_CXX_FLAGS to "-std=c++11 -stdlib=libc++" at top CMake level, and those flags are thus used by ALL dependant targets.
Yet, when grepping for "libstdc++", the AudioUnit target has dependency to libstdc++.dylib (although never set anywhere) and when I explicitly set LLVM "C++ Standard Library" in Xcode to libc++, linking goes through fine (!!)
I'm at the end of the rope, I have NO idea how otherwise to force the AU target to depend on libc++ instead of libstdc++.
Are there any explicit CMake XCODE attributes to use for this ?
Relevant flags to make it build:
SET(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
SET(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
Then it compiles+links without problems. No need for the extra -std=c++11... C++ flags.