@@ -136,85 +136,6 @@ if(NOT MSVC)
136
136
endif ()
137
137
endif ()
138
138
139
- # ---[ If we are using msvc, set no warning flags
140
- # Note(jiayq): if you are going to add a warning flag, check if this is
141
- # totally necessary, and only add when you see fit. If it is needed due to
142
- # a third party library (like Protobuf), mention it in the comment as
143
- # "THIRD_PARTY_NAME related"
144
- # From https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/
145
- if (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" )
146
- add_compile_options (
147
- ##########################################
148
- # Protobuf related. Cannot remove.
149
- # This is directly copied from
150
- # https://github.com/google/protobuf/blob/master/cmake/README.md
151
- ##########################################
152
- /wd4018 # 'expression' : signed/unsigned mismatch
153
- /wd4065 # (3): switch with default but no case.
154
- /wd4146 # unary minus operator applied to unsigned type, result still unsigned
155
- /wd4244 # Conversion from 'type1' to 'type2', possible loss of data.
156
- /wd4251 # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
157
- /wd4267 # Conversion from 'size_t' to 'type', possible loss of data.
158
- /wd4305 # 'identifier' : truncation from 'type1' to 'type2'
159
- /wd4355 # 'this' : used in base member initializer list
160
- /wd4506 # (1): no definition for inline function. Protobuf related.
161
- /wd4661 # No suitable definition provided for explicit template instantiation request
162
- /wd4800 # 'type' : forcing value to bool 'true' or 'false' (performance warning)
163
- /wd4996 # 'function': was declared deprecated
164
- ##########################################
165
- # Third party related. Cannot remove.
166
- ##########################################
167
- /wd4141 # (1): inline used twice. google benchmark related.
168
- /wd4503 # (1): decorated name length exceeded, name was truncated.
169
- # Eigen related.
170
- /wd4554 # (3): check operator precedence for possible error.
171
- # Eigen related.
172
- /wd4805 # (1): Unsafe mix of types in gtest/gtest.h. Gtest related.
173
- ##########################################
174
- # These are directly ATen related. However, several are covered by
175
- # the above now. We leave them here for documentation purposes only.
176
- #/wd4267 # Conversion from 'size_t' to 'type', possible loss of data.
177
- /wd4522 # (3): 'class' : multiple assignment operators specified
178
- /wd4838 # (1): conversion from 'type_1' to 'type_2' requires a
179
- # narrowing conversion
180
- #/wd4305 # 'identifier' : truncation from 'type1' to 'type2'
181
- #/wd4244 # Conversion from 'type1' to 'type2', possible loss of data.
182
- /wd4190 # (1): 'identifier1' has C-linkage specified, but returns UDT
183
- # 'identifier2' which is incompatible with C
184
- /wd4101 # (3): 'identifier' : unreferenced local variable
185
- #/wd4996 # (3): Use of deprecated POSIX functions. Since we develop
186
- # # mainly on Linux, this is ignored.
187
- /wd4275 # (2): non - DLL-interface classkey 'identifier' used as
188
- # base for DLL-interface classkey 'identifier'
189
- ##########################################
190
- # These are directly Caffe2 related. However, several are covered by
191
- # protobuf now. We leave them here for documentation purposes only.
192
- ##########################################
193
- #/wd4018 # (3): Signed/unsigned mismatch. We've used it in many places
194
- # # of the code and it would be hard to correct all.
195
- #/wd4244 # (2/3/4): Possible loss of precision. Various cases where we
196
- # # implicitly cast TIndex to int etc. Need cleaning.
197
- #/wd4267 # (3): Conversion of size_t to smaller type. Same as 4244.
198
- #/wd4996 # (3): Use of deprecated POSIX functions. Since we develop
199
- # # mainly on Linux, this is ignored.
200
- /wd4273 # (1): inconsistent dll linkage. This is related to the
201
- # caffe2 FLAGS_* definition using dllimport in header and
202
- # dllexport in cc file. The strategy is copied from gflags.
203
- )
204
-
205
- # Make sure windows.h does not include additional headers.
206
- add_definitions ("/DWIN32_LEAN_AND_MEAN" )
207
-
208
- # Make sure windef.h does not define max/min macros.
209
- # Required by ATen among others.
210
- add_definitions ("/DNOMINMAX" )
211
-
212
- set (CMAKE_SHARED_LINKER_FLAGS
213
- "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4049 /ignore:4217 /ignore:4099" )
214
- set (CMAKE_EXE_LINKER_FLAGS
215
- "${CMAKE_EXE_LINKER_FLAGS} /ignore:4049 /ignore:4217 /ignore:4099" )
216
- endif ()
217
-
218
139
# ---[ If we are building on ios, or building with opengl support, we will
219
140
# enable -mfpu=neon-fp16 for iOS Metal build. For Android, this fpu setting
220
141
# is going to be done with android-cmake by setting
0 commit comments