From 2a7284042531771b6c00a1e6fd1d0d36738266ac Mon Sep 17 00:00:00 2001 From: Tim Ebringer Date: Fri, 6 Oct 2017 14:26:43 -0400 Subject: 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. --- cmake/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7618ba21..9e2912e0 100644 --- a/cmake/CMakeLists.txt +++ b/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) -- cgit v1.2.3