[libcxx] Cleanup CMake configuration and integrate with LLVM
authorEric Fiselier <eric@efcs.ca>
Wed, 29 Jul 2015 00:03:51 +0000 (00:03 +0000)
committerEric Fiselier <eric@efcs.ca>
Wed, 29 Jul 2015 00:03:51 +0000 (00:03 +0000)
commit7eb30deff17e6e137cad170b340fcc7cf5f70761
treeb4aca259e13d05e1b865bcb89c1f5f684dc47a6e
parentcfe41f050c0c00a0840bd10907d9d22605e1c115
[libcxx] Cleanup CMake configuration and integrate with LLVM

Summary:
This patch contains the following changes:

1. Require that libc++ can find a LLVM source directory. This is done the same way as `libc++abi` currently does.
2. 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:

1. Help libc++ be more consistent with how LLVM handles CMake options (see PR23670 PR23671).
2. Make it easier to use sanitizers using the `LLVM_USE_SANITIZER` option.
3. Make libc++'s CMakeLists.txt file easier to understand and change.
4. Move towards allowing libc++ to create Sphinx documentation (see http://efcs.ca/libcxx-docs).
5. Move towards allowing  libc++ to use other LLVM utilities such as `not` and `FileCheck`.

Reviewers: mclow.lists, jroelofs, danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11308

llvm-svn: 243503
libcxx/CMakeLists.txt
libcxx/cmake/Modules/FindLLVM.cmake [new file with mode: 0644]
libcxx/cmake/Modules/HandleLibCXXABI.cmake
libcxx/cmake/Modules/HandleLibcxxFlags.cmake [new file with mode: 0644]
libcxx/cmake/config-ix.cmake
libcxx/lib/CMakeLists.txt
libcxx/test/CMakeLists.txt
libcxx/test/lit.site.cfg.in
libcxx/www/index.html