cmake: Include CheckCXXCompilerFlag where it is used (#113028)

Move the `include(CheckCXXCompilerFlag)` above the `append_cxx_flag_if_supported` function that uses it to avoid depending on the caller to have it already included.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/113028
Approved by: https://github.com/malfet
This commit is contained in:
Alexander Grund 2024-01-06 04:05:42 +00:00 committed by PyTorch MergeBot
parent 1badad9ce9
commit 78c3098470
2 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,6 @@ if(LINUX)
else()
# Please note this is required in order to ensure compatibility between gcc 9 and gcc 7
# This could be removed when all Linux PyTorch binary builds are compiled by the same toolchain again
include(CheckCXXCompilerFlag)
append_cxx_flag_if_supported("-fabi-version=11" CMAKE_CXX_FLAGS)
endif()
endif()

View File

@ -527,6 +527,8 @@ function(torch_update_find_cuda_flags)
endif()
endfunction()
include(CheckCXXCompilerFlag)
##############################################################################
# CHeck if given flag is supported and append it to provided outputvar
# Also define HAS_UPPER_CASE_FLAG_NAME variable