[libcxx-commits] [libcxx] [libc++][doc] Use installed std modules in external projects. (PR #80601)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 16 09:05:39 PDT 2024


================
@@ -107,24 +107,29 @@ Users need to be able to build their own BMI files.
 
 Currently this requires a local build of libc++ with modules enabled. Since
 modules are not part of the installation yet, they are used from the build
-directory. First libc++ needs to be build with module support enabled.
+directory. First libc++ needs to be build with module support enabled. If
+the libc++ is built with installation of modules enabled, they can also be
+used from the installation directory. The following instructions enable the
+installation of modules and install the modules into ``<install_prefix>``.
 
 .. code-block:: bash
 
   $ git clone https://github.com/llvm/llvm-project.git
   $ cd llvm-project
   $ mkdir build
-  $ cmake -G Ninja -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind"
+  $ cmake -G Ninja -S runtimes -B build -DCMAKE_INSTALL_PREFIX=<install_prefix> -DLIBCXX_INSTALL_MODULES=ON -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind"
   $ ninja -C build
+  $ ninja install -C build
 
 The above ``build`` directory will be referred to as ``<build>`` in the
 rest of these instructions.
 
-This is a small sample program that uses the module ``std``. It consists of a
-``CMakeLists.txt`` and a ``main.cpp`` file.
+This is a small sample program that uses the module ``std`` from build
----------------
mordante wrote:

```suggestion
This is a small sample program that uses the module ``std`` from the build
```

https://github.com/llvm/llvm-project/pull/80601


More information about the libcxx-commits mailing list