Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -307,9 +307,11 @@ include(HandleLibCXXABI) # Setup the ABI library flags -# Remove flags that may have snuck in. -remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG - -stdlib=libc++ -stdlib=libstdc++ -lc++abi -m32) +if (LIBCXX_STANDALONE_BUILD) + # Remove flags that may have snuck in. + remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG + -stdlib=libc++ -stdlib=libstdc++ -lc++abi -m32) +endif() # FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEDANTIC. # Remove the -pedantic flag and -Wno-pedantic and -pedantic-errors