1set(STATS_HEADERS 2 stats.h) 3 4include_directories(..) 5 6add_custom_target(stats) 7set_target_properties(stats PROPERTIES FOLDER "Compiler-RT Misc") 8 9if(APPLE) 10 set(STATS_LIB_FLAVOR SHARED) 11 12 set(STATS_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS}) 13 14 add_weak_symbols("asan" WEAK_SYMBOL_LINK_FLAGS) 15 add_weak_symbols("ubsan" WEAK_SYMBOL_LINK_FLAGS) 16 add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS) 17else() 18 set(STATS_LIB_FLAVOR STATIC) 19 20 set(WEAK_SYMBOL_LINK_FLAGS) 21endif() 22 23add_compiler_rt_runtime(clang_rt.stats 24 ${STATS_LIB_FLAVOR} 25 ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} 26 OS ${SANITIZER_COMMON_SUPPORTED_OS} 27 SOURCES stats.cpp 28 ADDITIONAL_HEADERS ${STATS_HEADERS} 29 OBJECT_LIBS RTSanitizerCommon 30 RTSanitizerCommonLibc 31 RTSanitizerCommonSymbolizer 32 CFLAGS ${SANITIZER_COMMON_CFLAGS} 33 LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS} 34 LINK_LIBS ${STATS_LINK_LIBS} 35 PARENT_TARGET stats) 36 37add_compiler_rt_runtime(clang_rt.stats_client 38 STATIC 39 ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} 40 OS ${SANITIZER_COMMON_SUPPORTED_OS} 41 SOURCES stats_client.cpp 42 ADDITIONAL_HEADERS ${STATS_HEADERS} 43 CFLAGS ${SANITIZER_COMMON_CFLAGS} 44 LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS} 45 PARENT_TARGET stats) 46