xref: /aosp_15_r20/external/compiler-rt/lib/cfi/CMakeLists.txt (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robotadd_custom_target(cfi)
2*7c3d14c8STreehugger Robotset_target_properties(cfi PROPERTIES FOLDER "Compiler-RT Misc")
3*7c3d14c8STreehugger Robot
4*7c3d14c8STreehugger Robotset(CFI_SOURCES cfi.cc)
5*7c3d14c8STreehugger Robot
6*7c3d14c8STreehugger Robotinclude_directories(..)
7*7c3d14c8STreehugger Robot
8*7c3d14c8STreehugger Robotset(CFI_CFLAGS
9*7c3d14c8STreehugger Robot  ${SANITIZER_COMMON_CFLAGS}
10*7c3d14c8STreehugger Robot)
11*7c3d14c8STreehugger Robot
12*7c3d14c8STreehugger Robotset(CFI_DIAG_CFLAGS
13*7c3d14c8STreehugger Robot  -DCFI_ENABLE_DIAG=1
14*7c3d14c8STreehugger Robot)
15*7c3d14c8STreehugger Robot
16*7c3d14c8STreehugger Robotforeach(arch ${CFI_SUPPORTED_ARCH})
17*7c3d14c8STreehugger Robot  add_compiler_rt_runtime(clang_rt.cfi
18*7c3d14c8STreehugger Robot    STATIC
19*7c3d14c8STreehugger Robot    ARCHS ${arch}
20*7c3d14c8STreehugger Robot    SOURCES ${CFI_SOURCES}
21*7c3d14c8STreehugger Robot    OBJECT_LIBS RTInterception
22*7c3d14c8STreehugger Robot                RTSanitizerCommon
23*7c3d14c8STreehugger Robot                RTSanitizerCommonLibc
24*7c3d14c8STreehugger Robot    CFLAGS ${CFI_CFLAGS}
25*7c3d14c8STreehugger Robot    PARENT_TARGET cfi)
26*7c3d14c8STreehugger Robot  add_compiler_rt_runtime(clang_rt.cfi_diag
27*7c3d14c8STreehugger Robot    STATIC
28*7c3d14c8STreehugger Robot    ARCHS ${arch}
29*7c3d14c8STreehugger Robot    SOURCES ${CFI_SOURCES}
30*7c3d14c8STreehugger Robot    OBJECT_LIBS RTInterception
31*7c3d14c8STreehugger Robot                RTSanitizerCommon
32*7c3d14c8STreehugger Robot                RTSanitizerCommonLibc
33*7c3d14c8STreehugger Robot		RTUbsan
34*7c3d14c8STreehugger Robot    CFLAGS ${CFI_CFLAGS} ${CFI_DIAG_CFLAGS}
35*7c3d14c8STreehugger Robot    PARENT_TARGET cfi)
36*7c3d14c8STreehugger Robotendforeach()
37*7c3d14c8STreehugger Robot
38*7c3d14c8STreehugger Robotadd_compiler_rt_resource_file(cfi_blacklist cfi_blacklist.txt cfi)
39*7c3d14c8STreehugger Robotadd_dependencies(compiler-rt cfi)
40