-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] depends: upstream patches to fix CMake
- Loading branch information
Showing
2 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Two upstream changes to the CMake build system: | ||
|
||
build: fix mkdtemp check on macOS | ||
|
||
On macOS, mkdtemp is in unistd.h. Fix the CMake check so that is works. | ||
This was discovered when comparing the output of the Autotools an CMake | ||
build systems. | ||
|
||
Upstreamed in https://github.com/zeromq/libzmq/pull/4668. | ||
|
||
cmake: don't use builtin sha1 if not using ws | ||
|
||
The builtin SHA1 (ZMQ_USE_BUILTIN_SHA1) is only used in the websocket | ||
engine (ws_engine.cpp), so if websockets are disabled, i.e | ||
-DENABLE_DRAFTS=OFF, don't add sha1.c to the sources list. | ||
|
||
Upstream in https://github.com/zeromq/libzmq/pull/4670. | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index c124a6a4..200a82e5 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -605,7 +605,7 @@ if(NOT MSVC) | ||
|
||
check_cxx_symbol_exists(fork unistd.h HAVE_FORK) | ||
check_cxx_symbol_exists(gethrtime sys/time.h HAVE_GETHRTIME) | ||
- check_cxx_symbol_exists(mkdtemp stdlib.h HAVE_MKDTEMP) | ||
+ check_cxx_symbol_exists(mkdtemp "stdlib.h;unistd.h" HAVE_MKDTEMP) | ||
check_cxx_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4) | ||
check_cxx_symbol_exists(strnlen string.h HAVE_STRNLEN) | ||
else() | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 200a82e5..6b62cc1e 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -234,7 +234,7 @@ if(NOT ZMQ_USE_GNUTLS) | ||
endif() | ||
endif() | ||
endif() | ||
- if(NOT ZMQ_USE_NSS) | ||
+ if(ENABLE_WS AND NOT ZMQ_USE_NSS) | ||
list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/external/sha1/sha1.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/external/sha1/sha1.h) | ||
message(STATUS "Using builtin sha1") |