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