1add_custom_target(cfi) 2set_target_properties(cfi PROPERTIES FOLDER "Compiler-RT Misc") 3 4set(CFI_SOURCES cfi.cc) 5 6include_directories(..) 7 8set(CFI_CFLAGS 9 ${SANITIZER_COMMON_CFLAGS} 10) 11 12set(CFI_DIAG_CFLAGS 13 -DCFI_ENABLE_DIAG=1 14) 15 16foreach(arch ${CFI_SUPPORTED_ARCH}) 17 add_compiler_rt_runtime(clang_rt.cfi 18 STATIC 19 ARCHS ${arch} 20 SOURCES ${CFI_SOURCES} 21 OBJECT_LIBS RTInterception 22 RTSanitizerCommon 23 RTSanitizerCommonLibc 24 CFLAGS ${CFI_CFLAGS} 25 PARENT_TARGET cfi) 26 add_compiler_rt_runtime(clang_rt.cfi_diag 27 STATIC 28 ARCHS ${arch} 29 SOURCES ${CFI_SOURCES} 30 OBJECT_LIBS RTInterception 31 RTSanitizerCommon 32 RTSanitizerCommonLibc 33 RTUbsan 34 CFLAGS ${CFI_CFLAGS} ${CFI_DIAG_CFLAGS} 35 PARENT_TARGET cfi) 36endforeach() 37 38add_compiler_rt_resource_file(cfi_blacklist cfi_blacklist.txt cfi) 39add_dependencies(compiler-rt cfi) 40