diff options
author | Nick Grifka <nigri@microsoft.com> | 2020-04-22 19:44:45 -0700 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2020-05-08 23:27:04 +0300 |
commit | 83ef3216e4a9f1711f260af3889c94cbcbbefacb (patch) | |
tree | bb95689293ca520fe6b1aac597215c8e751c22a5 /CMakeLists.txt | |
parent | 06a11929511bebaaf40c52aaf91de397b1782ba2 (diff) | |
download | libevent-83ef3216e4a9f1711f260af3889c94cbcbbefacb.tar.gz |
Add wepoll support to light up the epoll backend on Windows
libevent is lacking a scalable backend on Windows. Let's leverage the wepoll
library until Windows comes up with an epoll/kqueue compete user mode API.
- All regress tests pass for standard wepoll
- These 2 tests fail intermittently for changelist wepoll, so disabling
changelist wepoll for now
http/cancel_inactive_server
http/stream_in
- verify target on Windows runs tests for both wepoll and win32 backends
- wepoll backend preferred over win32 backend
- wepoll version 1.5.6
v2: cleaner backend abstraction. Disallow wepoll on MinGW/Cygwin.
v3: Add wepoll.h to dist
v4: Make sure wepoll source files are excluded from cygwin/mingw builds
v5: Keep win32 as default backend on windows.
v6: Include wepoll in mingw builds. Verified that regress tests pass w/ WEPOLL backend.
v7: Enable wepoll on mingw when building with cmake
v8: Add wepoll testrunner for autotools test target
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fd6595a1..9b064944 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -514,6 +514,9 @@ set(EVENT_INCLUDES ${EVENT_INCLUDES} stdio.h) CHECK_SYMBOLS_EXIST("${SYMBOLS_TO_CHECK}" "${EVENT_INCLUDES}" "EVENT") unset(SYMBOLS_TO_CHECK) set(EVENT__HAVE_EPOLL ${EVENT__HAVE_EPOLL_CREATE}) +if(WIN32 AND NOT CYGWIN) + set(EVENT__HAVE_WEPOLL 1) +endif() # Get the gethostbyname_r prototype. if(EVENT__HAVE_GETHOSTBYNAME_R) @@ -839,6 +842,12 @@ if(EVENT__HAVE_EPOLL) list(APPEND SRC_CORE epoll.c) endif() +if(EVENT__HAVE_WEPOLL) + list(APPEND SRC_CORE + epoll.c + wepoll.c) +endif() + if(EVENT__HAVE_EVENT_PORTS) list(APPEND SRC_CORE evport.c) endif() @@ -1240,6 +1249,10 @@ if (NOT EVENT__DISABLE_TESTS) list(APPEND BACKENDS DEVPOLL) endif() + if (EVENT__HAVE_WEPOLL) + list(APPEND BACKENDS WEPOLL) + endif() + if (WIN32) list(APPEND BACKENDS WIN32) endif() @@ -1382,13 +1395,12 @@ if (NOT EVENT__DISABLE_TESTS) # If they are set in the shell the tests are running using simply "ctest" or "make test" will fail) if (WIN32) # Windows doesn't have "unset". But you can use "set VAR=" instead. - # We need to guard against the possibility taht EVENT_NOWIN32 is set, and all test failing - # since no event backend being available. file(TO_NATIVE_PATH ${CMAKE_CTEST_COMMAND} WINDOWS_CTEST_COMMAND) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.bat " set EVENT_NOWIN32= + set EVENT_NOWEPOLL= \"${WINDOWS_CTEST_COMMAND}\" ") @@ -1410,7 +1422,7 @@ if (NOT EVENT__DISABLE_TESTS) add_custom_target(verify COMMAND "${VERIFY_PATH}" DEPENDS event ${ALL_TESTPROGS}) else() - # On some platforms doing exec(unset) as CMake does won't work, so make sure + # On some platforms doing exec(unset) as CMake doesn't work, so make sure # we run the unset command in a shell instead. # First we write the script contents. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.sh |