mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-26 23:01:04 +08:00
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.
This commit is contained in:
parent
92339a4d9d
commit
293a18257a
@ -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})
|
||||
|
Loading…
x
Reference in New Issue
Block a user