@@ -16,40 +16,44 @@ On Mac OS 10.7 (Lion) and later, the easiest way to get this library is to insta
16
16
Xcode 4.2 or later. However if you want to install tip-of-trunk from here
17
17
(getting the bleeding edge), read on.
18
18
19
- The basic steps needed to build libc++ are:
19
+ The following instructions describe how to checkout, build, test and
20
+ (optionally) install libc++ and libc++abi.
20
21
21
- #. Checkout and configure LLVM (including libc++ and libc++abi), according to the `LLVM
22
- getting started <https://llvm.org/docs/GettingStarted.html> `_ documentation. Make sure
23
- to include ``libcxx `` and ``libcxxabi `` in the ``LLVM_ENABLE_PROJECTS `` option passed
24
- to CMake.
22
+ If your system already provides a libc++ installation it is important to be
23
+ careful not to replace it. Remember Use the CMake option
24
+ ``CMAKE_INSTALL_PREFIX `` to select a safe place to install libc++.
25
25
26
- For more information about configuring libc++ see :ref: `CMake Options `.
27
-
28
- * ``make cxx `` --- will build libc++ and libc++abi.
29
- * ``make check-cxx check-cxxabi `` --- will run the test suites.
30
-
31
- Shared libraries for libc++ and libc++ abi should now be present in llvm/build/lib.
32
- See :ref: `using an alternate libc++ installation <alternate libcxx >`
33
-
34
- #. **Optional **: Install libc++ and libc++abi
35
-
36
- If your system already provides a libc++ installation it is important to be
37
- careful not to replace it. Remember Use the CMake option ``CMAKE_INSTALL_PREFIX `` to
38
- select a safe place to install libc++.
39
-
40
- * ``make install-cxx install-cxxabi `` --- Will install the libraries and the headers
26
+ .. warning ::
27
+ * Replacing your systems libc++ installation could render the system non-functional.
28
+ * macOS will not boot without a valid copy of ``libc++.1.dylib `` in ``/usr/lib ``.
41
29
42
- .. warning ::
43
- * Replacing your systems libc++ installation could render the system non-functional.
44
- * macOS will not boot without a valid copy of ``libc++.1.dylib `` in ``/usr/lib ``.
30
+ .. code-block :: bash
45
31
32
+ $ git clone https://github.com/llvm/llvm-project.git
33
+ $ cd llvm-project
34
+ $ mkdir build && cd build
35
+ $ cmake -DCMAKE_C_COMPILER=clang \
36
+ -DCMAKE_CXX_COMPILER=clang++ \
37
+ -DLLVM_ENABLE_PROJECTS=" libcxx;libcxxabi" \
38
+ ../llvm
39
+ $ make # Build
40
+ $ make check-cxx # Test
41
+ $ make install-cxx install-cxxabi # Install
42
+
43
+ For more information about configuring libc++ see :ref: `CMake Options `. You may
44
+ also want to read the `LLVM getting started
45
+ <https://llvm.org/docs/GettingStarted.html> `_ documentation.
46
+
47
+ Shared libraries for libc++ and libc++ abi should now be present in
48
+ ``build/lib ``. See :ref: `using an alternate libc++ installation <alternate
49
+ libcxx>` for information on how to use this libc++.
46
50
47
51
The instructions are for building libc++ on
48
52
FreeBSD, Linux, or Mac using `libc++abi `_ as the C++ ABI library.
49
53
On Linux, it is also possible to use :ref: `libsupc++ <libsupcxx >` or libcxxrt.
50
54
51
- It is sometimes beneficial to build separately from the full LLVM build. An
52
- out-of-tree build would look like this:
55
+ It is possible to keep your LLVM and libc++ trees separate so you can avoid
56
+ rebuilding LLVM as often. An out-of-tree build would look like this:
53
57
54
58
.. code-block :: bash
55
59
0 commit comments