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