1# Build for the EfficiencySanitizer runtime support library. 2 3add_custom_target(esan) 4set_target_properties(esan PROPERTIES FOLDER "Compiler-RT Misc") 5 6set(ESAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS}) 7append_rtti_flag(OFF ESAN_RTL_CFLAGS) 8 9include_directories(..) 10 11set(ESAN_SOURCES 12 esan.cpp 13 esan_flags.cpp 14 esan_interface.cpp 15 esan_interceptors.cpp 16 esan_linux.cpp 17 esan_sideline_linux.cpp 18 cache_frag.cpp 19 working_set.cpp 20 working_set_posix.cpp) 21 22foreach (arch ${ESAN_SUPPORTED_ARCH}) 23 add_compiler_rt_runtime(clang_rt.esan 24 STATIC 25 ARCHS ${arch} 26 SOURCES ${ESAN_SOURCES} 27 $<TARGET_OBJECTS:RTInterception.${arch}> 28 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> 29 $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> 30 CFLAGS ${ESAN_RTL_CFLAGS}) 31 add_sanitizer_rt_symbols(clang_rt.esan 32 ARCHS ${arch} 33 EXTRA esan.syms.extra) 34 add_dependencies(esan 35 clang_rt.esan-${arch} 36 clang_rt.esan-${arch}-symbols) 37endforeach() 38 39add_dependencies(compiler-rt esan) 40 41if (COMPILER_RT_INCLUDE_TESTS) 42 # TODO(bruening): add tests via add_subdirectory(tests) 43endif() 44