Suppress VS2017 compiler/linker warnings

VS2017 warns about a few additional things, for example, files that
define no symbols (which is typically the result of a platform specific
ifdef not applying on Windows).

Suppress these warnings so the build is clean on VS2017.
pull/3722/head
Tim Ebringer 7 years ago committed by Tim Ebringer
parent 77f64bb777
commit 2a72840425
  1. 5
      cmake/CMakeLists.txt

@ -135,12 +135,15 @@ endif (protobuf_BUILD_SHARED_LIBS)
if (MSVC)
# Build with multiple processes
add_definitions(/MP)
add_definitions(/wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146 /wd4305 /wd4309)
add_definitions(/wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146 /wd4305 /wd4309 /wd4065 /wd4506 /wd4307 /wd4334)
# Allow big object
add_definitions(/bigobj)
string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR})
string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR})
configure_file(extract_includes.bat.in extract_includes.bat)
# Suppress linker warnings about files with no symbols defined.
set(CMAKE_STATIC_LINKER_FLAGS /ignore:4221)
endif (MSVC)
get_filename_component(protobuf_source_dir ${protobuf_SOURCE_DIR} PATH)

Loading…
Cancel
Save