Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
d2293da6
Unverified
Commit
d2293da6
authored
Mar 12, 2018
by
Luca Boccassi
Committed by
GitHub
Mar 12, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2983 from tonytheodore/master
Fixes for mingw cross-compilation
parents
9c748f1b
c7876c09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
18 deletions
+28
-18
CMakeLists.txt
CMakeLists.txt
+28
-18
No files found.
CMakeLists.txt
View file @
d2293da6
...
...
@@ -192,13 +192,13 @@ endif ()
if
(
ZMQ_HAVE_WINDOWS
)
# Cannot use check_library_exists because the symbol is always declared as char(*)(void)
set
(
CMAKE_REQUIRED_LIBRARIES
"ws2_32.lib"
)
check_symbol_exists
(
WSAStartup
"
WinS
ock2.h"
HAVE_WS2_32
)
check_symbol_exists
(
WSAStartup
"
wins
ock2.h"
HAVE_WS2_32
)
set
(
CMAKE_REQUIRED_LIBRARIES
"rpcrt4.lib"
)
check_symbol_exists
(
UuidCreateSequential
"
R
pc.h"
HAVE_RPCRT4
)
check_symbol_exists
(
UuidCreateSequential
"
r
pc.h"
HAVE_RPCRT4
)
set
(
CMAKE_REQUIRED_LIBRARIES
"iphlpapi.lib"
)
check_symbol_exists
(
GetAdaptersAddresses
"winsock2.h;
I
phlpapi.h"
HAVE_IPHLAPI
)
check_symbol_exists
(
GetAdaptersAddresses
"winsock2.h;
i
phlpapi.h"
HAVE_IPHLAPI
)
set
(
CMAKE_REQUIRED_LIBRARIES
""
)
# TODO: This not the symbol we're looking for. What is the symbol?
...
...
@@ -911,20 +911,27 @@ if (MSVC)
DEBUG_POSTFIX
"
${
MSVC_TOOLSET
}
-mt-sgd-
${
ZMQ_VERSION_MAJOR
}
_
${
ZMQ_VERSION_MINOR
}
_
${
ZMQ_VERSION_PATCH
}
"
COMPILE_FLAGS
"/DZMQ_STATIC"
OUTPUT_NAME
"libzmq"
)
target_compile_definitions
(
libzmq-static
PUBLIC ZMQ_STATIC
)
endif
()
else
()
# avoid building everything twice for shared + static
# only on *nix, as Windows needs different preprocessor defines in static builds
add_library
(
objects OBJECT
${
sources
}
)
set_property
(
TARGET objects PROPERTY POSITION_INDEPENDENT_CODE ON
)
if
(
NOT MINGW
)
add_library
(
objects OBJECT
${
sources
}
)
set_property
(
TARGET objects PROPERTY POSITION_INDEPENDENT_CODE ON
)
target_include_directories
(
objects
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_BINARY_DIR
}
>
$<INSTALL_INTERFACE:include>
)
endif
()
if
(
BUILD_SHARED
)
add_library
(
libzmq SHARED $<TARGET_OBJECTS:objects>
${
public_headers
}
${
html-docs
}
${
readme-docs
}
${
zmq-pkgconfig
}
${
CMAKE_CURRENT_BINARY_DIR
}
/version.rc
)
if
(
MINGW
)
add_library
(
libzmq SHARED
${
sources
}
${
public_headers
}
${
html-docs
}
${
readme-docs
}
${
zmq-pkgconfig
}
${
CMAKE_CURRENT_BINARY_DIR
}
/version.rc
)
else
()
add_library
(
libzmq SHARED $<TARGET_OBJECTS:objects>
${
public_headers
}
${
html-docs
}
${
readme-docs
}
${
zmq-pkgconfig
}
${
CMAKE_CURRENT_BINARY_DIR
}
/version.rc
)
endif
()
# NOTE: the SOVERSION and VERSION MUST be the same as the one generated by libtool! It is NOT the same as the version of the package.
set_target_properties
(
libzmq PROPERTIES
COMPILE_DEFINITIONS
"DLL_EXPORT"
...
...
@@ -949,19 +956,22 @@ else ()
endif
()
if
(
BUILD_STATIC
)
add_library
(
libzmq-static STATIC $<TARGET_OBJECTS:objects>
${
public_headers
}
${
html-docs
}
${
readme-docs
}
${
zmq-pkgconfig
}
${
CMAKE_CURRENT_BINARY_DIR
}
/version.rc
)
if
(
MINGW
)
add_library
(
libzmq-static STATIC
${
sources
}
${
public_headers
}
${
html-docs
}
${
readme-docs
}
${
zmq-pkgconfig
}
${
CMAKE_CURRENT_BINARY_DIR
}
/version.rc
)
else
()
add_library
(
libzmq-static STATIC $<TARGET_OBJECTS:objects>
${
public_headers
}
${
html-docs
}
${
readme-docs
}
${
zmq-pkgconfig
}
${
CMAKE_CURRENT_BINARY_DIR
}
/version.rc
)
endif
()
set_target_properties
(
libzmq-static PROPERTIES
PUBLIC_HEADER
"
${
public_headers
}
"
COMPILE_DEFINITIONS
"ZMQ_STATIC"
OUTPUT_NAME
"zmq"
PREFIX
"lib"
)
endif
()
target_include_directories
(
objects
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_BINARY_DIR
}
>
$<INSTALL_INTERFACE:include>
endif
()
if
(
BUILD_STATIC
)
target_compile_definitions
(
libzmq-static
PUBLIC ZMQ_STATIC
)
endif
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment