Avoid unnecessary CMake warnings on Windows (#136393)

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/136393
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2024-09-23 06:42:57 +00:00
committed by PyTorch MergeBot
parent 663e760065
commit 75f141be62
2 changed files with 2 additions and 2 deletions

View File

@ -369,7 +369,7 @@ cmake_dependent_option(
USE_C10D_MPI "USE C10D MPI" ON "USE_DISTRIBUTED;USE_MPI" OFF) USE_C10D_MPI "USE C10D MPI" ON "USE_DISTRIBUTED;USE_MPI" OFF)
cmake_dependent_option( cmake_dependent_option(
USE_TENSORPIPE "Use TensorPipe. Only available if USE_DISTRIBUTED is on." ON USE_TENSORPIPE "Use TensorPipe. Only available if USE_DISTRIBUTED is on." ON
"USE_DISTRIBUTED" OFF) "USE_DISTRIBUTED AND NOT WIN32" OFF)
option(ONNX_ML "Enable traditional ONNX ML API." ON) option(ONNX_ML "Enable traditional ONNX ML API." ON)
option(HAVE_SOVERSION "Whether to add SOVERSION to the shared objects" OFF) option(HAVE_SOVERSION "Whether to add SOVERSION to the shared objects" OFF)
option(BUILD_LIBTORCH_CPU_WITH_DEBUG option(BUILD_LIBTORCH_CPU_WITH_DEBUG

View File

@ -110,7 +110,7 @@ endif()
# ---[ Create CAFFE2_BUILD_SHARED_LIBS for macros.h.in usage. # ---[ Create CAFFE2_BUILD_SHARED_LIBS for macros.h.in usage.
set(CAFFE2_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) set(CAFFE2_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
if(USE_NATIVE_ARCH) if(USE_NATIVE_ARCH AND NOT MSVC)
check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE) if(COMPILER_SUPPORTS_MARCH_NATIVE)
add_definitions("-march=native") add_definitions("-march=native")