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 endif(COMPILER_RT_BUILD_MEMPROF)
30 if (COMPILER_RT_BUILD_XRAY)
33 xray/xray_log_interface.h
36 endif(COMPILER_RT_BUILD_XRAY)
38 if (COMPILER_RT_BUILD_ORC)
42 endif(COMPILER_RT_BUILD_ORC)
44 if (COMPILER_RT_BUILD_PROFILE)
46 profile/InstrProfData.inc
48 endif(COMPILER_RT_BUILD_PROFILE)
50 set(COMPILER_RT_HEADERS
58 set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
60 # Copy compiler-rt headers to the build tree.
62 foreach( f ${COMPILER_RT_HEADERS} )
63 set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
64 set( dst ${output_dir}/${f} )
65 add_custom_command(OUTPUT ${dst}
67 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
68 COMMENT "Copying compiler-rt's ${f}...")
69 list(APPEND out_files ${dst})
72 add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
73 add_dependencies(compiler-rt compiler-rt-headers)
74 set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc")
76 # Install sanitizer headers.
77 install(FILES ${SANITIZER_HEADERS}
78 COMPONENT compiler-rt-headers
79 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
80 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
81 # Install fuzzer headers.
82 install(FILES ${FUZZER_HEADERS}
83 COMPONENT compiler-rt-headers
84 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
85 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/fuzzer)
86 # Install memprof headers.
87 if (COMPILER_RT_BUILD_MEMPROF)
88 install(FILES sanitizer/memprof_interface.h
89 COMPONENT compiler-rt-headers
90 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
91 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/sanitizer)
92 endif(COMPILER_RT_BUILD_MEMPROF)
93 # Install xray headers.
94 install(FILES ${XRAY_HEADERS}
95 COMPONENT compiler-rt-headers
96 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
97 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/xray)
98 # Install ORC headers.
99 install(FILES ${ORC_HEADERS}
100 COMPONENT compiler-rt-headers
101 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
102 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/orc)
103 # Install profile headers.
104 install(FILES ${PROFILE_HEADERS}
105 COMPONENT compiler-rt-headers
106 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
107 DESTINATION ${COMPILER_RT_INSTALL_INCLUDE_DIR}/profile)
109 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
110 add_custom_target(install-compiler-rt-headers
111 DEPENDS compiler-rt-headers
112 COMMAND "${CMAKE_COMMAND}"
113 -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
114 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
116 add_custom_target(install-compiler-rt-headers-stripped
117 DEPENDS compiler-rt-headers
118 COMMAND "${CMAKE_COMMAND}"
119 -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers"
120 -DCMAKE_INSTALL_DO_STRIP=1
121 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"