|
| 1 | +# Swift Supplemental Libraries |
| 2 | + |
| 3 | +The supplemental libraries are all libraries that are not one of the Core or |
| 4 | +overlay libraries. Each supplemental library builds as an independent project. |
| 5 | + |
| 6 | +The supplemental libraries are: |
| 7 | + - CxxInterop |
| 8 | + - Differentiation |
| 9 | + - Distributed |
| 10 | + - Observation |
| 11 | + - StringProcessing |
| 12 | + - Runtime |
| 13 | + - Synchronization |
| 14 | + |
| 15 | +The top-level Supplemental CMakeLists supplies a super-build pattern for |
| 16 | +configuring and compiling each of the supplemental library projects through a |
| 17 | +single CMake invocation. The `Swift_ENABLE_RUNTIMES` CMake option enables the |
| 18 | +specified supplemental libraries. All libraries configured this way are built |
| 19 | +with the same compilers, against the same sysroot, with the same target triple |
| 20 | +and installed into the same location. |
| 21 | + |
| 22 | +## Super-Build |
| 23 | + |
| 24 | +Configuring each project independently is tedious. The Supplemental directory |
| 25 | +contains a Super-Build CMakeLists that invokes the build of each of the |
| 26 | +supplemental libraries in the appropriate order, simplifying the process of |
| 27 | +building each library. |
| 28 | + |
| 29 | +Important configuration variables: |
| 30 | + - `Swift_ENABLE_RUNTIMES`: Used to configure which runtime libraries are built. |
| 31 | + |
| 32 | +The super-build forwards the following variables to each sub-project |
| 33 | +unconditionally: |
| 34 | + - `BUILD_SHARED_LIBS` |
| 35 | + - `CMAKE_BUILD_TYPE` |
| 36 | + - `CMAKE_INSTALL_PREFIX` |
| 37 | + - `CMAKE_COLOR_DIAGNOSTICS` |
| 38 | + - `CMAKE_C_COMPILER` |
| 39 | + - `CMAKE_C_COMPILER_TARGET` |
| 40 | + - `CMAKE_CXX_COMPILER` |
| 41 | + - `CMAKE_CXX_COMPILER_TARGET` |
| 42 | + - `CMAKE_Swift_COMPILER` |
| 43 | + - `CMAKE_Swift_COMPILER_TARGET` |
| 44 | + |
| 45 | +If set, the super-build forwards the following values to each sub-project: |
| 46 | + |
| 47 | + - `SwiftCore_DIR`: Path to the SwiftCore build directory |
| 48 | + - `CMAKE_MAKE_PROGRAM`: Path to `ninja` |
| 49 | + |
| 50 | +The super-build is for convenience. If more fine-grained control is desired for |
| 51 | +configuring a specific runtime library, you may configure that library |
| 52 | +independently. |
0 commit comments