mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
lower cmake version requirement in FindSanitizer.cmake (#97073)
As indicated by the last comment from PR #93147, we should replace CheckSourceRuns in **cmake/Modules/FindSanitizer.cmake** with older versions to avoid dependency on CMake 3.19+ Pull Request resolved: https://github.com/pytorch/pytorch/pull/97073 Approved by: https://github.com/vfdev-5, https://github.com/Skylion007
This commit is contained in:
@ -53,10 +53,18 @@ foreach(sanitizer_name IN ITEMS address thread undefined leak memory)
|
|||||||
|
|
||||||
set(CMAKE_REQUIRED_QUIET ON)
|
set(CMAKE_REQUIRED_QUIET ON)
|
||||||
set(_run_res 0)
|
set(_run_res 0)
|
||||||
include(CheckSourceRuns)
|
include(CheckCSourceRuns)
|
||||||
|
include(CheckCXXSourceRuns)
|
||||||
foreach(lang IN LISTS languages)
|
foreach(lang IN LISTS languages)
|
||||||
if(lang STREQUAL CXX OR lang STREQUAL C)
|
if(lang STREQUAL C)
|
||||||
check_source_runs(${lang} "${_source_code}"
|
check_c_source_runs("${_source_code}"
|
||||||
|
__${lang}_${sanitizer_name}_res)
|
||||||
|
if(__${lang}_${sanitizer_name}_res)
|
||||||
|
set(_run_res 1)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(lang STREQUAL CXX)
|
||||||
|
check_cxx_source_runs("${_source_code}"
|
||||||
__${lang}_${sanitizer_name}_res)
|
__${lang}_${sanitizer_name}_res)
|
||||||
if(__${lang}_${sanitizer_name}_res)
|
if(__${lang}_${sanitizer_name}_res)
|
||||||
set(_run_res 1)
|
set(_run_res 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user