[Clang][SME2] Enable multi-vector loads & stores for SME2 (#75821)
[llvm-project.git] / compiler-rt / include / CMakeLists.txt
blob78427beedb3cc4e0f3d6e37e4d241f4741fab66e
1 if (COMPILER_RT_BUILD_SANITIZERS)
2   set(SANITIZER_HEADERS
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
17     )
18   set(FUZZER_HEADERS
19     fuzzer/FuzzedDataProvider.h
20     )
21 endif(COMPILER_RT_BUILD_SANITIZERS)
23 if (COMPILER_RT_BUILD_MEMPROF)
24   set(MEMPROF_HEADERS
25     sanitizer/memprof_interface.h
26     profile/MemProfData.inc
27     )
28 endif(COMPILER_RT_BUILD_MEMPROF)
30 if (COMPILER_RT_BUILD_XRAY)
31   set(XRAY_HEADERS
32     xray/xray_interface.h
33     xray/xray_log_interface.h
34     xray/xray_records.h
35     )
36 endif(COMPILER_RT_BUILD_XRAY)
38 if (COMPILER_RT_BUILD_ORC)
39   set(ORC_HEADERS
40     orc_rt/c_api.h
41     )
42 endif(COMPILER_RT_BUILD_ORC)
44 if (COMPILER_RT_BUILD_PROFILE)
45   set(PROFILE_HEADERS
46     profile/InstrProfData.inc
47     )
48 endif(COMPILER_RT_BUILD_PROFILE)
50 set(COMPILER_RT_HEADERS
51   ${SANITIZER_HEADERS}
52   ${FUZZER_HEADERS}
53   ${MEMPROF_HEADERS}
54   ${XRAY_HEADERS}
55   ${ORC_HEADERS}
56   ${PROFILE_HEADERS})
58 set(output_dir ${COMPILER_RT_OUTPUT_DIR}/include)
60 # Copy compiler-rt headers to the build tree.
61 set(out_files)
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}
66     DEPENDS ${src}
67     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
68     COMMENT "Copying compiler-rt's ${f}...")
69   list(APPEND out_files ${dst})
70 endforeach( f )
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"
115                     USES_TERMINAL)
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"
122                     USES_TERMINAL)
123 endif()