mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-14 17:58:01 +08:00
do not mix DLL_EXPORT & ZMQ_STATIC definitions
This commit is contained in:
parent
1d2b34dbe4
commit
7dfa7b7a5d
@ -158,10 +158,6 @@ set(CMAKE_REQUIRED_INCLUDES )
|
|||||||
|
|
||||||
add_definitions(-D_REENTRANT -D_THREAD_SAFE)
|
add_definitions(-D_REENTRANT -D_THREAD_SAFE)
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
add_definitions(-DDLL_EXPORT)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(ENABLE_EVENTFD "Enable/disable eventfd" ZMQ_HAVE_EVENTFD)
|
option(ENABLE_EVENTFD "Enable/disable eventfd" ZMQ_HAVE_EVENTFD)
|
||||||
|
|
||||||
macro(zmq_check_cxx_flag_prepend flag)
|
macro(zmq_check_cxx_flag_prepend flag)
|
||||||
@ -345,7 +341,6 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-DWIN32
|
-DWIN32
|
||||||
-DDLL_EXPORT
|
|
||||||
# NB: May require tweaking for highly connected applications.
|
# NB: May require tweaking for highly connected applications.
|
||||||
-DFD_SETSIZE=4096
|
-DFD_SETSIZE=4096
|
||||||
-D_CRT_SECURE_NO_WARNINGS)
|
-D_CRT_SECURE_NO_WARNINGS)
|
||||||
@ -585,7 +580,8 @@ if(MSVC)
|
|||||||
PUBLIC_HEADER "${public_headers}"
|
PUBLIC_HEADER "${public_headers}"
|
||||||
RELEASE_POSTFIX "${_zmq_COMPILER}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
RELEASE_POSTFIX "${_zmq_COMPILER}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
||||||
DEBUG_POSTFIX "${_zmq_COMPILER}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
DEBUG_POSTFIX "${_zmq_COMPILER}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
|
||||||
|
COMPILE_DEFINITIONS "DLL_EXPORT")
|
||||||
add_library(libzmq-static STATIC ${sources})
|
add_library(libzmq-static STATIC ${sources})
|
||||||
set_target_properties(libzmq-static PROPERTIES
|
set_target_properties(libzmq-static PROPERTIES
|
||||||
PUBLIC_HEADER "${public_headers}"
|
PUBLIC_HEADER "${public_headers}"
|
||||||
@ -595,11 +591,11 @@ if(MSVC)
|
|||||||
OUTPUT_NAME "libzmq")
|
OUTPUT_NAME "libzmq")
|
||||||
else()
|
else()
|
||||||
add_library(libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig})
|
add_library(libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig})
|
||||||
|
set_target_properties(libzmq PROPERTIES COMPILE_DEFINITIONS "DLL_EXPORT" PUBLIC_HEADER "${public_headers}")
|
||||||
if(ZMQ_BUILD_FRAMEWORK)
|
if(ZMQ_BUILD_FRAMEWORK)
|
||||||
set_target_properties(libzmq PROPERTIES
|
set_target_properties(libzmq PROPERTIES
|
||||||
FRAMEWORK TRUE
|
FRAMEWORK TRUE
|
||||||
OUTPUT_NAME "ZeroMQ"
|
OUTPUT_NAME "ZeroMQ"
|
||||||
PUBLIC_HEADER "${public_headers}"
|
|
||||||
MACOSX_FRAMEWORK_IDENTIFIER "org.zeromq.libzmq"
|
MACOSX_FRAMEWORK_IDENTIFIER "org.zeromq.libzmq"
|
||||||
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${ZMQ_VERSION}
|
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${ZMQ_VERSION}
|
||||||
MACOSX_FRAMEWORK_BUNDLE_VERSION ${ZMQ_VERSION}
|
MACOSX_FRAMEWORK_BUNDLE_VERSION ${ZMQ_VERSION}
|
||||||
@ -613,13 +609,12 @@ else()
|
|||||||
MACOSX_PACKAGE_LOCATION lib/pkgconfig)
|
MACOSX_PACKAGE_LOCATION lib/pkgconfig)
|
||||||
else()
|
else()
|
||||||
set_target_properties(libzmq PROPERTIES
|
set_target_properties(libzmq PROPERTIES
|
||||||
OUTPUT_NAME "zmq"
|
OUTPUT_NAME "zmq")
|
||||||
PUBLIC_HEADER "${public_headers}")
|
|
||||||
endif()
|
endif()
|
||||||
add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig})
|
add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig})
|
||||||
set_target_properties(libzmq-static PROPERTIES
|
set_target_properties(libzmq-static PROPERTIES
|
||||||
PUBLIC_HEADER "${public_headers}"
|
PUBLIC_HEADER "${public_headers}"
|
||||||
COMPILE_FLAGS "-DZMQ_STATIC"
|
COMPILE_DEFINITIONS "ZMQ_STATIC"
|
||||||
OUTPUT_NAME "zmq-static")
|
OUTPUT_NAME "zmq-static")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user