This patch contains the following changes:
- Require that libc++ can find a LLVM source directory. This is done the same way as libc++abi currently does.
- Cleanup ugly configuration code in CMakeLists.txt by using add_flags, add_flags_if, and add_flags_if_supported macros.
The goals for this patch are:
- Help libc++ be more consistent with how LLVM handles CMake options (see PR23670 PR23671).
- Make it easier to use sanitizers using the LLVM_USE_SANITIZER option.
- Make libc++'s CMakeLists.txt file easier to understand and change.
- Move towards allowing libc++ to create Sphinx documentation (see http://efcs.ca/libcxx-docs).
- Move towards allowing libc++ to use other LLVM utilities such as not and FileCheck.