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/rtsan_interface.h
14 sanitizer/scudo_interface.h
15 sanitizer/tsan_interface.h
16 sanitizer/tsan_interface_atomic.h
17 sanitizer/ubsan_interface.h
20 fuzzer/FuzzedDataProvider.h
22 endif(COMPILER_RT_BUILD_SANITIZERS)
24 if (COMPILER_RT_BUILD_MEMPROF)
26 sanitizer/memprof_interface.h
27 profile/MemProfData.inc
29 if (NOT COMPILER_RT_BUILD_SANITIZERS)
32 sanitizer/allocator_interface.h
33 sanitizer/common_interface_defs.h
36 endif(COMPILER_RT_BUILD_MEMPROF)
38 if (COMPILER_RT_BUILD_XRAY)
41 xray/xray_log_interface.h
44 endif(COMPILER_RT_BUILD_XRAY)
46 if (COMPILER_RT_BUILD_ORC)
50 endif(COMPILER_RT_BUILD_ORC)
52 if (COMPILER_RT_BUILD_PROFILE)
54 profile/InstrProfData.inc
55 profile/instr_prof_interface.h
57 endif(COMPILER_RT_BUILD_PROFILE)
59 set(COMPILER_RT_HEADERS
67 set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
69 # Copy compiler-rt headers to the build tree.
71 foreach( f ${COMPILER_RT_HEADERS} )
72 set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
73 set( dst ${output_dir}/${f} )
74 add_custom_command(OUTPUT ${dst}
76 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
77 COMMENT "Copying compiler-rt's ${f}...")
78 list(APPEND out_files ${dst})
81 add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
82 add_dependencies(compiler-rt compiler-rt-headers)
83 set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT/Resources")
85 # Install sanitizer headers.
86 install(FILES ${SANITIZER_HEADERS}
87 COMPONENT compiler-rt-headers
88 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
89 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
90 # Install fuzzer headers.
91 install(FILES ${FUZZER_HEADERS}
92 COMPONENT compiler-rt-headers
93 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
94 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/fuzzer)
95 # Install memprof headers.
96 if (COMPILER_RT_BUILD_MEMPROF)
97 install(FILES sanitizer/memprof_interface.h
98 COMPONENT compiler-rt-headers
99 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
100 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
101 if (NOT COMPILER_RT_BUILD_SANITIZERS)
102 install(FILES sanitizer/allocator_interface.h sanitizer/common_interface_defs.h
103 COMPONENT compiler-rt-headers
104 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
105 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
107 endif(COMPILER_RT_BUILD_MEMPROF)
108 # Install xray headers.
109 install(FILES ${XRAY_HEADERS}
110 COMPONENT compiler-rt-headers
111 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
112 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/xray)
113 # Install ORC headers.
114 install(FILES ${ORC_HEADERS}
115 COMPONENT compiler-rt-headers
116 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
117 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/orc)
118 # Install profile headers.
119 install(FILES ${PROFILE_HEADERS}
120 COMPONENT compiler-rt-headers
121 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
122 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/profile)
124 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
125 add_custom_target(install-compiler-rt-headers
126 DEPENDS compiler-rt-headers
127 COMMAND "${CMAKE_COMMAND}"
128 -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
129 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
131 add_custom_target(install-compiler-rt-headers-stripped
132 DEPENDS compiler-rt-headers
133 COMMAND "${CMAKE_COMMAND}"
134 -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
135 -DCMAKE_INSTALL_DO_STRIP=1
136 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"