[libcxx] Add support for building and testing with an ABI library not along linker...
authorEric Fiselier <eric@efcs.ca>
Sat, 18 Oct 2014 01:15:17 +0000 (01:15 +0000)
committerEric Fiselier <eric@efcs.ca>
Sat, 18 Oct 2014 01:15:17 +0000 (01:15 +0000)
commit6f9da55c0ff5c55b0bef1bc4907f9ce0915a10aa
tree2f6418e0c6a7626d4ade1ba6ce36c329630997d5
parentf83ba5eb0f6e928be6138de57ab3a6268e3baaf0
[libcxx] Add support for building and testing with an ABI library not along linker paths

Summary:
This patch adds support for building/testing libc++ with an ABI library that the linker would not normally find.

- `CMAKE_LIBRARY_PATH` is used to specify the list of search directories.
- The ABI library is now found using `find_library` instead of assuming its along the linker's search path.
- `CMAKE_LIBRARY_PATH` is passed to our LIT config as `library_paths`.
- For each path in `library_paths` the following flags are added `-L<path> -Wl,-rpath -Wl,<path>`

Some changes in existing behavior were also added:
- `target_link_libraries` is now passed the ABI library file instead of the library name. Ex `target_link_libraries(cxx "/usr/lib/libc++abi.so")` vs `target_link_libraries(cxx "c++abi")`.
- `-Wl,-rpath -Wl,<path>` is now used on OSX to link to libc++ instead of env['DYLD_LIBRARY_PATH'] if `use_system_lib=False`.

Reviewers: mclow.lists, danalbert, EricWF

Reviewed By: EricWF

Subscribers: emaste, cfe-commits

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

llvm-svn: 220118
libcxx/CMakeLists.txt
libcxx/cmake/Modules/HandleLibCXXABI.cmake [new file with mode: 0644]
libcxx/test/lit.cfg
libcxx/test/lit.site.cfg.in
libcxx/www/index.html