1a9ac8606Spatrick# This file sets up a CMakeCache for a simple build with multiple distributions.
2*12c85518Srobert# Note that for a real distribution, you likely want to perform a bootstrap
3a9ac8606Spatrick# build; see clang/cmake/caches/DistributionExample.cmake and the
4a9ac8606Spatrick# BuildingADistribution documentation for details. This cache file doesn't
5a9ac8606Spatrick# demonstrate bootstrapping so it can focus on the configuration details
6a9ac8606Spatrick# specific to multiple distributions instead.
7a9ac8606Spatrick
8a9ac8606Spatrick# Build an optimized toolchain for an example set of targets.
9a9ac8606Spatrickset(CMAKE_BUILD_TYPE Release CACHE STRING "")
10a9ac8606Spatrickset(LLVM_TARGETS_TO_BUILD
11a9ac8606Spatrick      AArch64
12a9ac8606Spatrick      ARM
13a9ac8606Spatrick      X86
14a9ac8606Spatrick    CACHE STRING "")
15a9ac8606Spatrick
16a9ac8606Spatrick# Enable the LLVM projects and runtimes.
17a9ac8606Spatrickset(LLVM_ENABLE_PROJECTS
18a9ac8606Spatrick      clang
19a9ac8606Spatrick      lld
20a9ac8606Spatrick    CACHE STRING "")
21a9ac8606Spatrickset(LLVM_ENABLE_RUNTIMES
22a9ac8606Spatrick      compiler-rt
23a9ac8606Spatrick      libcxx
24a9ac8606Spatrick      libcxxabi
25a9ac8606Spatrick    CACHE STRING "")
26a9ac8606Spatrick
27a9ac8606Spatrick# We'll build two distributions: Toolchain, which just holds the tools
28a9ac8606Spatrick# (intended for most end users), and Development, which has libraries (for end
29a9ac8606Spatrick# users who wish to develop their own tooling using those libraries). This will
30a9ac8606Spatrick# produce the install-toolchain-distribution and install-development-distribution
31a9ac8606Spatrick# targets to install the distributions.
32a9ac8606Spatrickset(LLVM_DISTRIBUTIONS
33a9ac8606Spatrick      Toolchain
34a9ac8606Spatrick      Development
35a9ac8606Spatrick    CACHE STRING "")
36a9ac8606Spatrick
37a9ac8606Spatrick# We want to include the C++ headers in our distribution.
38a9ac8606Spatrickset(LLVM_RUNTIME_DISTRIBUTION_COMPONENTS
39a9ac8606Spatrick      cxx-headers
40a9ac8606Spatrick    CACHE STRING "")
41a9ac8606Spatrick
42a9ac8606Spatrick# You likely want more tools; this is just an example :) Note that we need to
43a9ac8606Spatrick# include cxx-headers explicitly here (in addition to it being added to
44a9ac8606Spatrick# LLVM_RUNTIME_DISTRIBUTION_COMPONENTS above).
45a9ac8606Spatrickset(LLVM_Toolchain_DISTRIBUTION_COMPONENTS
46a9ac8606Spatrick      builtins
47a9ac8606Spatrick      clang
48a9ac8606Spatrick      clang-resource-headers
49a9ac8606Spatrick      cxx-headers
50a9ac8606Spatrick      lld
51a9ac8606Spatrick      llvm-objdump
52a9ac8606Spatrick    CACHE STRING "")
53a9ac8606Spatrick
54a9ac8606Spatrick# Note that we need to include the CMake exports targets for the distribution
55a9ac8606Spatrick# (development-cmake-exports and clang-development-cmake-exports), as well as
56a9ac8606Spatrick# the general CMake exports target for each project (cmake-exports and
57a9ac8606Spatrick# clang-cmake-exports), in our list of targets. The distribution CMake exports
58a9ac8606Spatrick# targets just install the CMake exports file for the distribution's targets,
59a9ac8606Spatrick# whereas the project CMake exports targets install the rest of the project's
60a9ac8606Spatrick# CMake exports (which are needed in order to import the project from other
61a9ac8606Spatrick# CMake_projects via find_package, and include the distribution's CMake exports
62a9ac8606Spatrick# file to get the exported targets).
63a9ac8606Spatrickset(LLVM_Development_DISTRIBUTION_COMPONENTS
64a9ac8606Spatrick      # LLVM
65a9ac8606Spatrick      cmake-exports
66a9ac8606Spatrick      development-cmake-exports
67a9ac8606Spatrick      llvm-headers
68a9ac8606Spatrick      llvm-libraries
69a9ac8606Spatrick      # Clang
70a9ac8606Spatrick      clang-cmake-exports
71a9ac8606Spatrick      clang-development-cmake-exports
72a9ac8606Spatrick      clang-headers
73a9ac8606Spatrick      clang-libraries
74a9ac8606Spatrick    CACHE STRING "")
75