File: CMakeLists.txt

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (116 lines) | stat: -rw-r--r-- 3,767 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
if (COMPILER_RT_BUILD_SANITIZERS)
  set(SANITIZER_HEADERS
    sanitizer/allocator_interface.h
    sanitizer/asan_interface.h
    sanitizer/common_interface_defs.h
    sanitizer/coverage_interface.h
    sanitizer/dfsan_interface.h
    sanitizer/hwasan_interface.h
    sanitizer/linux_syscall_hooks.h
    sanitizer/lsan_interface.h
    sanitizer/msan_interface.h
    sanitizer/netbsd_syscall_hooks.h
    sanitizer/scudo_interface.h
    sanitizer/tsan_interface.h
    sanitizer/tsan_interface_atomic.h
    sanitizer/ubsan_interface.h
    )
  set(FUZZER_HEADERS
    fuzzer/FuzzedDataProvider.h
    )
endif(COMPILER_RT_BUILD_SANITIZERS)

if (COMPILER_RT_BUILD_MEMPROF)
  set(MEMPROF_HEADERS
    sanitizer/memprof_interface.h
    profile/MemProfData.inc
    )
endif(COMPILER_RT_BUILD_MEMPROF)

if (COMPILER_RT_BUILD_XRAY)
  set(XRAY_HEADERS
    xray/xray_interface.h
    xray/xray_log_interface.h
    xray/xray_records.h
    )
endif(COMPILER_RT_BUILD_XRAY)

if (COMPILER_RT_BUILD_ORC)
  set(ORC_HEADERS
    orc/c_api.h
    )
endif(COMPILER_RT_BUILD_ORC)

if (COMPILER_RT_BUILD_PROFILE)
  set(PROFILE_HEADERS
    profile/InstrProfData.inc
    )
endif(COMPILER_RT_BUILD_PROFILE)

set(COMPILER_RT_HEADERS
  ${SANITIZER_HEADERS}
  ${FUZZER_HEADERS}
  ${MEMPROF_HEADERS}
  ${XRAY_HEADERS}
  ${ORC_HEADERS}
  ${PROFILE_HEADERS})

set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)

# Copy compiler-rt headers to the build tree.
set(out_files)
foreach( f ${COMPILER_RT_HEADERS} )
  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
  set( dst ${output_dir}/${f} )
  add_custom_command(OUTPUT ${dst}
    DEPENDS ${src}
    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
    COMMENT "Copying compiler-rt's ${f}...")
  list(APPEND out_files ${dst})
endforeach( f )

add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
add_dependencies(compiler-rt compiler-rt-headers)
set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc")

# Install sanitizer headers.
install(FILES ${SANITIZER_HEADERS}
  COMPONENT compiler-rt-headers
  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
  DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
# Install fuzzer headers.
install(FILES ${FUZZER_HEADERS}
  COMPONENT compiler-rt-headers
  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
  DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/fuzzer)
# Install xray headers.
install(FILES ${XRAY_HEADERS}
  COMPONENT compiler-rt-headers
  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
  DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/xray)
# Install ORC headers.
install(FILES ${ORC_HEADERS}
  COMPONENT compiler-rt-headers
  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
  DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/orc)
# Install profile headers.
install(FILES ${PROFILE_HEADERS}
  COMPONENT compiler-rt-headers
  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
  DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/profile)

if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
  add_custom_target(install-compiler-rt-headers
                    DEPENDS compiler-rt-headers
                    COMMAND "${CMAKE_COMMAND}"
                            -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
                            -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
                    USES_TERMINAL)
  add_custom_target(install-compiler-rt-headers-stripped
                    DEPENDS compiler-rt-headers
                    COMMAND "${CMAKE_COMMAND}"
                            -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
                            -DCMAKE_INSTALL_DO_STRIP=1
                            -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
                    USES_TERMINAL)
endif()