Commit 293a1825 authored by Tim Ebringer's avatar Tim Ebringer

Suppress linker warning 4221 for MSVC

Some #define switches cause the body of entire files to be omitted. This
causes a linker warning on Visual Studio 2017, for example

    warning LNK4221: This object file does not define any previously
    undefined public symbols, so it will not be used by any link
    operation that consumes this library

Since this is warning us about something that shouldn't be
earth-shattering news, we add a linker flag to suppress this warning on
MSVC builds.
parent 92339a4d
......@@ -741,6 +741,9 @@ if (BUILD_STATIC)
endif()
if (MSVC)
# Suppress linker warnings caused by #ifdef omission
# of file content.
set( CMAKE_STATIC_LINKER_FLAGS /ignore:4221 )
if (BUILD_SHARED)
add_library (libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in)
target_link_libraries (libzmq ${OPTIONAL_LIBRARIES})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment