mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
dont force msvc /Ox flag which can conflict with /RTC1 in debug config (#33164)
Summary: Relates to https://github.com/pytorch/pytorch/issues/33132 This fix doesn't add full multi-configuration support described in https://github.com/pytorch/pytorch/issues/33132 but at least avoid the error presented in the issue when `CMAKE_BUILD_TYPE=Debug` is used with MSVC. Pull Request resolved: https://github.com/pytorch/pytorch/pull/33164 Differential Revision: D19899727 Pulled By: ezyang fbshipit-source-id: 28a364d920c4a3fb577c6b484ccd69a133fbcf5d
This commit is contained in:
parent
602aec325d
commit
0150f40dde
|
|
@ -53,16 +53,14 @@ install(FILES ${CMAKE_BINARY_DIR}/caffe2/core/macros.h
|
|||
|
||||
# ---[ ATen specific
|
||||
if (INTERN_BUILD_ATEN_OPS)
|
||||
SET(OPT_FLAG "-O3 ")
|
||||
IF(MSVC)
|
||||
SET(OPT_FLAG "/Ox /fp:strict ")
|
||||
ENDIF()
|
||||
SET(VCOMP_LIB "vcomp")
|
||||
|
||||
SET(OPT_FLAG "/fp:strict ")
|
||||
ELSE(MSVC)
|
||||
SET(OPT_FLAG "-O3 ")
|
||||
IF("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
|
||||
SET(OPT_FLAG " ")
|
||||
SET(VCOMP_LIB "vcompd")
|
||||
ENDIF()
|
||||
ENDIF(MSVC)
|
||||
|
||||
IF(C_AVX_FOUND)
|
||||
IF(MSVC)
|
||||
|
|
|
|||
|
|
@ -305,8 +305,14 @@ endfunction()
|
|||
# torch_set_target_props(lib_name)
|
||||
function(torch_set_target_props libname)
|
||||
if(MSVC AND AT_MKL_MT)
|
||||
set(VCOMP_LIB "vcomp")
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS_MINSIZEREL "/NODEFAULTLIB:${VCOMP_LIB}")
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/NODEFAULTLIB:${VCOMP_LIB}")
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB:${VCOMP_LIB}")
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB:${VCOMP_LIB}")
|
||||
set_target_properties(${libname} PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB:${VCOMP_LIB}")
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB:${VCOMP_LIB}d")
|
||||
set_target_properties(${libname} PROPERTIES STATIC_LIBRARY_FLAGS_MINSIZEREL "/NODEFAULTLIB:${VCOMP_LIB}")
|
||||
set_target_properties(${libname} PROPERTIES STATIC_LIBRARY_FLAGS_RELWITHDEBINFO "/NODEFAULTLIB:${VCOMP_LIB}")
|
||||
set_target_properties(${libname} PROPERTIES STATIC_LIBRARY_FLAGS_RELEASE "/NODEFAULTLIB:${VCOMP_LIB}")
|
||||
set_target_properties(${libname} PROPERTIES STATIC_LIBRARY_FLAGS_DEBUG "/NODEFAULTLIB:${VCOMP_LIB}d")
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user