title: Mac OS X 10.8 and llvm/clang 3.3 via homebrew
body: <p>I have latest version of XCode installed on my Mac OS X 10.8 with LLVM 3.2. Now I would like to switch to llvm/clang 3.3.</p>
  
  <p>In my current project I use CMake with clang 3.2 and libc++ which are working fine.</p>
  
  <p>Now I thought I could switch using homebrew. So what I did was issuing the following command:</p>
  
  <pre><code>brew install llvm --with-clang --with-asan
  </code></pre>
  
  <p>This built new clang and updated it in /usr/local/bin.</p>
  
  <p>Running cmake with the following parameters:</p>
  
  <pre><code>cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/local/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ ../
  </code></pre>
  
  <p>Succeeded and my CMake output looks like:</p>
  
  <pre><code>
  -- Compiler: Clang
  -- CXX_FLAGS: -Wall -std=c++11 -stdlib=libc++
  -- Boost version: 1.53.0
  -- adding include directory: /usr/local/include
  -- adding include directory: /usr/local/include
  -- adding include directory: /usr/local/include
  -- adding include directory: /usr/local/include
  -- Boost version: 1.53.0
  -- Found the following Boost libraries:
  --   filesystem
  --   system
  --   exception
  -- Boost version: 1.53.0
  -- Found the following Boost libraries:
  --   unit_test_framework
  --   thread
  -- Configuring done
  -- Generating done
  </code></pre>
  
  <p>But if I start building my project I receive an error:</p>
  
  <pre><code>
  [  2%] Building CXX object code/CMakeFiles/.../resource.cpp.o
  In file included from /Users/.../code/net/resource.cpp:1:
  /Users/.../resource.hpp:6:10: fatal error: 'string' file not found
  #include &lt;string>
           ^
  1 error generated.
  </code></pre>
  
  <p>So obviously standard header is not found, which with clang 3.2 was found. What can be causing this problem?</p>
  
  <p><strong>Remark:</strong>
  I think my problem is that brew builds llvm/clang with libstdc++ instead of libc++. Is there any way I can force it to use libc++? Or is there any other easy way to upgrade clang on OS X and use libc++?</p>