Build LSan on x86_64 only if this target is supported

llvm-svn: 182272
This commit is contained in:
Alexey Samsonov 2013-05-20 14:16:45 +00:00
parent b289fe64c1
commit cbbdfc50ee
1 changed files with 12 additions and 8 deletions

View File

@ -14,13 +14,17 @@ set(LSAN_SOURCES
set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LSAN_RUNTIME_LIBRARIES)
set(arch "x86_64")
add_compiler_rt_static_runtime(clang_rt.lsan-${arch} ${arch}
SOURCES ${LSAN_SOURCES}
$<TARGET_OBJECTS:RTInterception.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
CFLAGS ${LSAN_CFLAGS})
list(APPEND LSAN_RUNTIME_LIBRARIES clang_rt.lsan-${arch})
# FIXME: support LSan for other arches.
if(CAN_TARGET_x86_64)
set(arch "x86_64")
add_compiler_rt_static_runtime(clang_rt.lsan-${arch} ${arch}
SOURCES ${LSAN_SOURCES}
$<TARGET_OBJECTS:RTInterception.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
CFLAGS ${LSAN_CFLAGS})
list(APPEND LSAN_RUNTIME_LIBRARIES clang_rt.lsan-${arch})
endif()
add_subdirectory(tests)