Skip to content

Commit 75f141b

Browse files
cyyeverpytorchmergebot
authored andcommitted
Avoid unnecessary CMake warnings on Windows (pytorch#136393)
Fixes #ISSUE_NUMBER Pull Request resolved: pytorch#136393 Approved by: https://github.com/ezyang
1 parent 663e760 commit 75f141b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ cmake_dependent_option(
369369
USE_C10D_MPI "USE C10D MPI" ON "USE_DISTRIBUTED;USE_MPI" OFF)
370370
cmake_dependent_option(
371371
USE_TENSORPIPE "Use TensorPipe. Only available if USE_DISTRIBUTED is on." ON
372-
"USE_DISTRIBUTED" OFF)
372+
"USE_DISTRIBUTED AND NOT WIN32" OFF)
373373
option(ONNX_ML "Enable traditional ONNX ML API." ON)
374374
option(HAVE_SOVERSION "Whether to add SOVERSION to the shared objects" OFF)
375375
option(BUILD_LIBTORCH_CPU_WITH_DEBUG

cmake/MiscCheck.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ endif()
110110
# ---[ Create CAFFE2_BUILD_SHARED_LIBS for macros.h.in usage.
111111
set(CAFFE2_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
112112

113-
if(USE_NATIVE_ARCH)
113+
if(USE_NATIVE_ARCH AND NOT MSVC)
114114
check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
115115
if(COMPILER_SUPPORTS_MARCH_NATIVE)
116116
add_definitions("-march=native")

0 commit comments

Comments
 (0)