File: MultiDistributionExample.cmake

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (74 lines) | stat: -rw-r--r-- 2,691 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This file sets up a CMakeCache for a simple build with multiple distributions.
# Note that for a real distribution, you likely want to perform a boostrap
# build; see clang/cmake/caches/DistributionExample.cmake and the
# BuildingADistribution documentation for details. This cache file doesn't
# demonstrate bootstrapping so it can focus on the configuration details
# specific to multiple distributions instead.

# Build an optimized toolchain for an example set of targets.
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
set(LLVM_TARGETS_TO_BUILD
      AArch64
      ARM
      X86
    CACHE STRING "")

# Enable the LLVM projects and runtimes.
set(LLVM_ENABLE_PROJECTS
      clang
      lld
    CACHE STRING "")
set(LLVM_ENABLE_RUNTIMES
      compiler-rt
      libcxx
      libcxxabi
    CACHE STRING "")

# We'll build two distributions: Toolchain, which just holds the tools
# (intended for most end users), and Development, which has libraries (for end
# users who wish to develop their own tooling using those libraries). This will
# produce the install-toolchain-distribution and install-development-distribution
# targets to install the distributions.
set(LLVM_DISTRIBUTIONS
      Toolchain
      Development
    CACHE STRING "")

# We want to include the C++ headers in our distribution.
set(LLVM_RUNTIME_DISTRIBUTION_COMPONENTS
      cxx-headers
    CACHE STRING "")

# You likely want more tools; this is just an example :) Note that we need to
# include cxx-headers explicitly here (in addition to it being added to
# LLVM_RUNTIME_DISTRIBUTION_COMPONENTS above).
set(LLVM_Toolchain_DISTRIBUTION_COMPONENTS
      builtins
      clang
      clang-resource-headers
      cxx-headers
      lld
      llvm-objdump
    CACHE STRING "")

# Note that we need to include the CMake exports targets for the distribution
# (development-cmake-exports and clang-development-cmake-exports), as well as
# the general CMake exports target for each project (cmake-exports and
# clang-cmake-exports), in our list of targets. The distribution CMake exports
# targets just install the CMake exports file for the distribution's targets,
# whereas the project CMake exports targets install the rest of the project's
# CMake exports (which are needed in order to import the project from other
# CMake_projects via find_package, and include the distribution's CMake exports
# file to get the exported targets).
set(LLVM_Development_DISTRIBUTION_COMPONENTS
      # LLVM
      cmake-exports
      development-cmake-exports
      llvm-headers
      llvm-libraries
      # Clang
      clang-cmake-exports
      clang-development-cmake-exports
      clang-headers
      clang-libraries
    CACHE STRING "")