From 7dfa7b7a5d2bbc5c1a935b5289321ad9bfe500cc Mon Sep 17 00:00:00 2001 From: xantares Date: Wed, 11 Mar 2015 09:03:21 +0000 Subject: [PATCH] do not mix DLL_EXPORT & ZMQ_STATIC definitions --- CMakeLists.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cf20627..d7d6c917 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,10 +158,6 @@ set(CMAKE_REQUIRED_INCLUDES ) add_definitions(-D_REENTRANT -D_THREAD_SAFE) -if(WIN32) - add_definitions(-DDLL_EXPORT) -endif() - option(ENABLE_EVENTFD "Enable/disable eventfd" ZMQ_HAVE_EVENTFD) macro(zmq_check_cxx_flag_prepend flag) @@ -345,7 +341,6 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib) if(MSVC) add_definitions( -DWIN32 - -DDLL_EXPORT # NB: May require tweaking for highly connected applications. -DFD_SETSIZE=4096 -D_CRT_SECURE_NO_WARNINGS) @@ -585,7 +580,8 @@ if(MSVC) PUBLIC_HEADER "${public_headers}" 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}" - 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}) set_target_properties(libzmq-static PROPERTIES PUBLIC_HEADER "${public_headers}" @@ -595,11 +591,11 @@ if(MSVC) OUTPUT_NAME "libzmq") else() 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) set_target_properties(libzmq PROPERTIES FRAMEWORK TRUE OUTPUT_NAME "ZeroMQ" - PUBLIC_HEADER "${public_headers}" MACOSX_FRAMEWORK_IDENTIFIER "org.zeromq.libzmq" MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${ZMQ_VERSION} MACOSX_FRAMEWORK_BUNDLE_VERSION ${ZMQ_VERSION} @@ -613,13 +609,12 @@ else() MACOSX_PACKAGE_LOCATION lib/pkgconfig) else() set_target_properties(libzmq PROPERTIES - OUTPUT_NAME "zmq" - PUBLIC_HEADER "${public_headers}") + OUTPUT_NAME "zmq") endif() add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig}) set_target_properties(libzmq-static PROPERTIES PUBLIC_HEADER "${public_headers}" - COMPILE_FLAGS "-DZMQ_STATIC" + COMPILE_DEFINITIONS "ZMQ_STATIC" OUTPUT_NAME "zmq-static") endif()