title: Trouble building tests with Google Test, Clang, and libc++
body: <p>I tried building Google Test with the following CMake configuration:</p>
  
  <pre><code>$ CMAKE_CXX_COMPILER="clang++" CMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -U__STRICT_ANSI__" cmake ../source
  </code></pre>
  
  <p>Building shows CMake picked the right compiler, but my compiler flags aren't passing through:</p>
  
  <pre><code>$ VERBOSE=1 make
  ...
  /Users/jfreeman/local/bin/clang++    -I/Users/jfreeman/work/googletest/source/include -I/Users/jfreeman/work/googletest/source      -DGTEST_HAS_PTHREAD=1   -o CMakeFiles/gtest.dir/src/gtest-all.cc.o -c /Users/jfreeman/work/googletest/source/src/gtest-all.cc
  ...
  /Users/jfreeman/local/bin/clang++    -I/Users/jfreeman/work/googletest/source/include -I/Users/jfreeman/work/googletest/source      -DGTEST_HAS_PTHREAD=1   -o CMakeFiles/gtest_main.dir/src/gtest_main.cc.o -c /Users/jfreeman/work/googletest/source/src/gtest_main.cc
  </code></pre>
  
  <p>The end goal is that I want my project, which builds with Clang and libc++, to have tests built with Google Test. That means I need Google Test built with libc++ as well.</p>