Skip to content

Commit 95a7825

Browse files
committed
Add additional warning to ignore to boringssl build.
1 parent 25c182f commit 95a7825

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

cmake/external/boringssl.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if(TARGET boringssl OR NOT DOWNLOAD_BORINGSSL)
1919
endif()
2020

2121
set(patch_file
22-
${CMAKE_CURRENT_LIST_DIR}/../../scripts/git/patches/boringssl/0001-disable-C4255-converting-empty-params-to-void.patch)
22+
${CMAKE_CURRENT_LIST_DIR}/../../scripts/git/patches/boringssl/0001-disable-warnings.patch)
2323

2424
set(boringssl_commit_tag 83da28a68f32023fd3b95a8ae94991a07b1f6c62)
2525

cmake/external_rules.cmake

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ function(build_external_dependencies)
188188
set(CMAKE_SUB_BUILD_OPTIONS ${CMAKE_SUB_BUILD_OPTIONS}
189189
--config Release)
190190
endif()
191-
# On Windows, disable warning 4191: unsafe type conversion
192-
set(disable_warnings "/WD4191")
193191
if(MSVC_RUNTIME_LIBRARY_STATIC)
194192
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
195193
-DCMAKE_C_FLAGS_RELEASE="/MT"
@@ -198,13 +196,13 @@ function(build_external_dependencies)
198196
-DCMAKE_CXX_FLAGS_DEBUG="/MTd")
199197
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
200198
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
201-
-DCMAKE_C_FLAGS="/MTd ${disable_warnings}"
202-
-DCMAKE_CXX_FLAGS="/MTd ${disable_warnings}"
199+
-DCMAKE_C_FLAGS="/MTd"
200+
-DCMAKE_CXX_FLAGS="/MTd"
203201
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug)
204202
else()
205203
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
206-
-DCMAKE_C_FLAGS="/MT ${disable_warnings}"
207-
-DCMAKE_CXX_FLAGS="/MT ${disable_warnings}"
204+
-DCMAKE_C_FLAGS="/MT"
205+
-DCMAKE_CXX_FLAGS="/MT"
208206
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded)
209207
endif()
210208
else() # dynamic (DLL) runtime
@@ -215,13 +213,13 @@ function(build_external_dependencies)
215213
-DCMAKE_CXX_FLAGS_DEBUG="/MDd")
216214
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
217215
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
218-
-DCMAKE_C_FLAGS="/MDd ${disable_warnings}"
219-
-DCMAKE_CXX_FLAGS="/MDd ${disable_warnings}"
216+
-DCMAKE_C_FLAGS="/MDd"
217+
-DCMAKE_CXX_FLAGS="/MDd"
220218
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL)
221219
else()
222220
set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
223-
-DCMAKE_C_FLAGS="/MD ${disable_warnings}"
224-
-DCMAKE_CXX_FLAGS="/MD ${disable_warnings}"
221+
-DCMAKE_C_FLAGS="/MD"
222+
-DCMAKE_CXX_FLAGS="/MD"
225223
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL)
226224
endif()
227225
endif()
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
1111
index b7f468fe6..48f61bfd8 100644
1212
--- a/src/CMakeLists.txt
1313
+++ b/src/CMakeLists.txt
14-
@@ -193,6 +193,8 @@ elseif(MSVC)
14+
@@ -193,7 +193,10 @@ elseif(MSVC)
1515
# possible loss of data
1616
"C4244" # 'function' : conversion from 'int' to 'uint8_t',
1717
# possible loss of data
1818
+ "C4255" # 'function' : no function prototype given: converting '()' to
1919
+ # '(void)'
20+
+ "C4191" # 'operator/operation' : unsafe conversion from 'type of
21+
+ # expression' to 'type required'
2022
"C4267" # conversion from 'size_t' to 'int', possible loss of data
2123
"C4371" # layout of class may have changed from a previous version of the
2224
# compiler due to better packing of member '...'

0 commit comments

Comments
 (0)