From: Sacha Date: Mon, 1 Apr 2019 14:23:06 +0000 (-0700) Subject: Move flags that do not work on MSVC (#18686) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~515 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8276d82f7892e6dd000800651e5e04e67ba1189b;p=platform%2Fupstream%2Fpytorch.git Move flags that do not work on MSVC (#18686) Summary: MSVC errors on these flags as they are not supported Pull Request resolved: https://github.com/pytorch/pytorch/pull/18686 Differential Revision: D14704254 Pulled By: ezyang fbshipit-source-id: 936d33ed6b7474d7774a49505cdac50dbe8dd99a --- diff --git a/CMakeLists.txt b/CMakeLists.txt index dbf2fa7..0b0bafc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,6 +299,8 @@ if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized") endif() + set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -O0") + set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -O0") else() foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE @@ -318,8 +320,6 @@ else() endforeach(flag_var) endif() -set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -O0") -set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -O0") if (USE_ASAN) set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address") set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS_DEBUG} -fsanitize=address")