1 if (COMPILER_RT_BUILD_SANITIZERS)
3 sanitizer/allocator_interface.h
4 sanitizer/asan_interface.h
5 sanitizer/common_interface_defs.h
6 sanitizer/coverage_interface.h
7 sanitizer/dfsan_interface.h
8 sanitizer/hwasan_interface.h
9 sanitizer/linux_syscall_hooks.h
10 sanitizer/lsan_interface.h
11 sanitizer/msan_interface.h
12 sanitizer/netbsd_syscall_hooks.h
13 sanitizer/scudo_interface.h
14 sanitizer/tsan_interface.h
15 sanitizer/tsan_interface_atomic.h
16 sanitizer/ubsan_interface.h
19 fuzzer/FuzzedDataProvider.h
21 endif(COMPILER_RT_BUILD_SANITIZERS)
23 if (COMPILER_RT_BUILD_MEMPROF)
25 sanitizer/memprof_interface.h
26 profile/MemProfData.inc
28 if (NOT COMPILER_RT_BUILD_SANITIZERS)
31 sanitizer/allocator_interface.h
32 sanitizer/common_interface_defs.h
35 endif(COMPILER_RT_BUILD_MEMPROF)
37 if (COMPILER_RT_BUILD_XRAY)
40 xray/xray_log_interface.h
43 endif(COMPILER_RT_BUILD_XRAY)
45 if (COMPILER_RT_BUILD_ORC)
49 endif(COMPILER_RT_BUILD_ORC)
51 if (COMPILER_RT_BUILD_PROFILE)
53 profile/InstrProfData.inc
54 profile/instr_prof_interface.h
56 endif(COMPILER_RT_BUILD_PROFILE)
58 set(COMPILER_RT_HEADERS
66 set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
68 # Copy compiler-rt headers to the build tree.
70 foreach( f ${COMPILER_RT_HEADERS} )
71 set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
72 set( dst ${output_dir}/${f} )
73 add_custom_command(OUTPUT ${dst}
75 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
76 COMMENT "Copying compiler-rt's ${f}...")
77 list(APPEND out_files ${dst})
80 add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
81 add_dependencies(compiler-rt compiler-rt-headers)
82 set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT/Resources")
84 # Install sanitizer headers.
85 install(FILES ${SANITIZER_HEADERS}
86 COMPONENT compiler-rt-headers
87 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
88 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
89 # Install fuzzer headers.
90 install(FILES ${FUZZER_HEADERS}
91 COMPONENT compiler-rt-headers
92 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
93 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/fuzzer)
94 # Install memprof headers.
95 if (COMPILER_RT_BUILD_MEMPROF)
96 install(FILES sanitizer/memprof_interface.h
97 COMPONENT compiler-rt-headers
98 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
99 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
100 if (NOT COMPILER_RT_BUILD_SANITIZERS)
101 install(FILES sanitizer/allocator_interface.h sanitizer/common_interface_defs.h
102 COMPONENT compiler-rt-headers
103 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
104 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
106 endif(COMPILER_RT_BUILD_MEMPROF)
107 # Install xray headers.
108 install(FILES ${XRAY_HEADERS}
109 COMPONENT compiler-rt-headers
110 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
111 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/xray)
112 # Install ORC headers.
113 install(FILES ${ORC_HEADERS}
114 COMPONENT compiler-rt-headers
115 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
116 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/orc)
117 # Install profile headers.
118 install(FILES ${PROFILE_HEADERS}
119 COMPONENT compiler-rt-headers
120 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
121 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/profile)
123 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
124 add_custom_target(install-compiler-rt-headers
125 DEPENDS compiler-rt-headers
126 COMMAND "${CMAKE_COMMAND}"
127 -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
128 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
130 add_custom_target(install-compiler-rt-headers-stripped
131 DEPENDS compiler-rt-headers
132 COMMAND "${CMAKE_COMMAND}"
133 -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
134 -DCMAKE_INSTALL_DO_STRIP=1
135 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"