[build] fix compiling with clang13 (#80916)

This check is incorrect; clang 13.1.0 doesn't exist.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80916
Approved by: https://github.com/malfet
This commit is contained in:
Michael Suo 2022-07-05 16:52:17 -07:00 committed by PyTorch MergeBot
parent 45f77189c1
commit b349d15907

View file

@ -824,7 +824,8 @@ if(USE_FBGEMM)
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
# See https://github.com/pytorch/pytorch/issues/74352
target_compile_options(asmjit PRIVATE -Wno-deprecated-copy)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.1.0)
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.6)
OR("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0))
# -Wno-unused-but-set-variable doesn't exist in Apple clang version 13.0.0 (clang-1300.0.29.30)
target_compile_options(asmjit PRIVATE -Wno-unused-but-set-variable)
endif()