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