mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[build] Add LeakSanitizer option to CMake (#158686)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/158686 Approved by: https://github.com/eellison
This commit is contained in:
committed by
PyTorch MergeBot
parent
af60398c3a
commit
bdbe931d58
@ -1830,6 +1830,12 @@ if(BUILD_TEST)
|
||||
target_link_libraries(${test_name}_${CPU_CAPABILITY} Sanitizer::undefined)
|
||||
endif()
|
||||
endif()
|
||||
if(USE_LSAN AND TARGET Sanitizer::leak)
|
||||
target_link_libraries(${test_name}_${CPU_CAPABILITY} Sanitizer::leak)
|
||||
endif()
|
||||
if(USE_TSAN AND TARGET Sanitizer::thread)
|
||||
target_link_libraries(${test_name}_${CPU_CAPABILITY} Sanitizer::thread)
|
||||
endif()
|
||||
else()
|
||||
add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
|
||||
target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library sleef gtest_main)
|
||||
|
Reference in New Issue
Block a user