2013-12-09 18:05:32 +01:00
#
# Libevent CMake project
#
2014-09-02 18:25:52 +04:00
# Based on initial work by:
2013-12-09 18:05:32 +01:00
# Alexey Ozeritsky
#
# Additional changes:
# Brodie Thiesfield
2014-09-02 18:25:52 +04:00
# Joakim Soderberg
2014-02-19 06:31:27 +01:00
# Trond Norbye
2014-09-02 18:25:52 +04:00
# Sergei Nikulov
2013-12-09 18:05:32 +01:00
#
# Build example:
#
# cd libevent
# md build
# cd build
# cmake -G "Visual Studio 10" ..
# start libevent.sln
#
2018-11-22 23:00:11 +03:00
2019-06-26 00:59:41 +03:00
cmake_minimum_required ( VERSION 3.1.2 FATAL_ERROR )
2017-11-02 14:58:17 +08:00
if ( POLICY CMP0054 )
cmake_policy ( SET CMP0054 NEW )
endif ( )
2018-11-05 18:23:31 +03:00
if ( POLICY CMP0074 )
cmake_policy ( SET CMP0074 NEW )
endif ( )
2018-11-05 18:30:38 +03:00
if ( POLICY CMP0075 )
cmake_policy ( SET CMP0075 NEW )
endif ( )
2013-12-09 18:05:32 +01:00
2015-12-19 01:47:49 -08:00
if ( NOT CMAKE_BUILD_TYPE )
2015-12-20 00:43:46 -08:00
set ( CMAKE_BUILD_TYPE Release
2019-09-02 11:11:58 +03:00
C A C H E S T R I N G " S e t b u i l d t y p e t o D e b u g o r Release ( default Release ) " F O R C E )
2015-12-19 01:47:49 -08:00
endif ( )
2016-11-01 23:33:11 +03:00
string ( TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER )
2015-12-19 01:47:49 -08:00
2013-12-09 18:05:32 +01:00
# get rid of the extra default configurations
2015-12-19 01:47:49 -08:00
# what? why would you get id of other useful build types? - Ellzey
2013-12-09 18:05:32 +01:00
set ( CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Limited configurations" FORCE )
2018-11-22 23:00:11 +03:00
set ( EVENT__LIBRARY_TYPE DEFAULT CACHE STRING
2018-11-23 00:29:55 +03:00
" S e t l i b r a r y t y p e t o S H A R E D / S T A T I C / BOTH ( default SHARED for MSVC, otherwise BOTH ) " )
2018-11-22 23:00:11 +03:00
2013-12-19 10:54:52 +01:00
project ( libevent C )
2013-12-09 18:05:32 +01:00
2015-12-20 00:43:46 -08:00
set ( CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/" )
2016-08-10 00:16:48 +03:00
string ( REGEX MATCH "SunOS" SOLARIS "${CMAKE_SYSTEM_NAME}" )
2015-12-20 00:43:46 -08:00
2015-12-21 04:36:24 -08:00
include ( CheckTypeSize )
2015-12-20 00:43:46 -08:00
include ( CheckFunctionExistsEx )
include ( CheckFileOffsetBits )
include ( CheckFunctionExists )
include ( CheckIncludeFile )
include ( CheckIncludeFiles )
include ( CheckVariableExists )
include ( CheckSymbolExists )
include ( CheckStructHasMember )
include ( CheckCSourceCompiles )
include ( CheckPrototypeDefinition )
include ( CheckFunctionKeywords )
2017-01-30 03:17:41 +03:00
include ( CheckConstExists )
2015-12-20 00:43:46 -08:00
include ( AddCompilerFlags )
include ( VersionViaGit )
2014-02-19 06:31:27 +01:00
2015-12-20 00:43:46 -08:00
event_fuzzy_version_from_git ( )
2015-12-19 01:47:49 -08:00
2015-12-20 00:43:46 -08:00
set ( EVENT_VERSION_MAJOR ${ EVENT_GIT___VERSION_MAJOR } )
set ( EVENT_VERSION_MINOR ${ EVENT_GIT___VERSION_MINOR } )
set ( EVENT_VERSION_PATCH ${ EVENT_GIT___VERSION_PATCH } )
2015-12-20 21:44:04 -08:00
set ( EVENT_VERSION_STAGE ${ EVENT_GIT___VERSION_STAGE } )
2015-12-19 01:47:49 -08:00
2014-02-19 06:31:27 +01:00
2015-12-20 00:43:46 -08:00
set ( EVENT_ABI_MAJOR ${ EVENT_VERSION_MAJOR } )
set ( EVENT_ABI_MINOR ${ EVENT_VERSION_MINOR } )
set ( EVENT_ABI_PATCH ${ EVENT_VERSION_PATCH } )
2015-12-19 01:47:49 -08:00
2015-12-20 00:43:46 -08:00
set ( EVENT_ABI_LIBVERSION
" $ { E V E N T _ A B I _ M A J O R } . $ { E V E N T _ A B I _ M I N O R } . $ { E V E N T _ A B I _ P A T C H } " )
2015-12-19 01:47:49 -08:00
2015-12-20 00:43:46 -08:00
set ( EVENT_PACKAGE_VERSION
" $ { E V E N T _ V E R S I O N _ M A J O R } . $ { E V E N T _ V E R S I O N _ M I N O R } . $ { E V E N T _ V E R S I O N _ P A T C H } " )
2019-07-10 00:30:12 +08:00
# equals to VERSION_INFO in Makefile.am
set ( EVENT_ABI_LIBVERSION_CURRENT 1 )
set ( EVENT_ABI_LIBVERSION_REVISION 0 )
set ( EVENT_ABI_LIBVERSION_AGE 0 )
# equals to RELEASE in Makefile.am
set ( EVENT_PACKAGE_RELEASE 2.2 )
2017-01-29 18:13:07 +03:00
set ( EVENT_NUMERIC_VERSION 0x02020001 )
2015-12-19 01:47:49 -08:00
# only a subset of names can be used, defaults to "beta"
2017-01-29 20:19:06 +03:00
set ( EVENT_STAGE_NAME ${ EVENT_VERSION_STAGE } )
2015-12-19 01:47:49 -08:00
# a list that defines what can set for EVENT_STAGE_VERSION
set ( EVENT__ALLOWED_STAGE_NAMES
2017-01-29 20:19:06 +03:00
r c
b e t a
a l p h a
a l p h a - d e v
r e l e a s e
s t a b l e
)
list (
F I N D E V E N T _ _ A L L O W E D _ S T A G E _ N A M E S
" $ { E V E N T _ S T A G E _ N A M E } "
E V E N T _ _ S T A G E _ R E T
)
if ( EVENT__STAGE_RET EQUAL -1 )
message ( WARNING
" s t a g e $ { E V E N T _ S T A G E _ N A M E } i s n o t a l l o w e d , r e s e t t o b e t a " )
2015-12-21 17:43:00 -08:00
set ( EVENT_STAGE_NAME beta )
2015-12-19 01:47:49 -08:00
endif ( )
2015-12-20 00:43:46 -08:00
set ( EVENT_VERSION
2015-12-20 21:44:04 -08:00
" $ { E V E N T _ V E R S I O N _ M A J O R } . $ { E V E N T _ V E R S I O N _ M I N O R } . $ { E V E N T _ V E R S I O N _ P A T C H } - $ { E V E N T _ S T A G E _ N A M E } " )
2015-12-20 00:43:46 -08:00
option ( EVENT__DISABLE_DEBUG_MODE
" D e f i n e i f l i b e v e n t s h o u l d b u i l d w i t h o u t s u p p o r t f o r a d e b u g m o d e " O F F )
option ( EVENT__ENABLE_VERBOSE_DEBUG
" E n a b l e s v e r b o s e d e b u g g i n g " O F F )
option ( EVENT__DISABLE_MM_REPLACEMENT
" D e f i n e i f l i b e v e n t s h o u l d n o t a l l o w r e p l a c i n g t h e m m f u n c t i o n s " O F F )
option ( EVENT__DISABLE_THREAD_SUPPORT
" D e f i n e i f l i b e v e n t s h o u l d n o t b e c o m p i l e d w i t h t h r e a d s u p p o r t " O F F )
option ( EVENT__DISABLE_OPENSSL
2018-12-15 12:54:31 +01:00
" D e f i n e i f l i b e v e n t s h o u l d b u i l d w i t h o u t s u p p o r t f o r O p e n S S L e n c r y p t i o n " O F F )
2015-12-20 00:43:46 -08:00
option ( EVENT__DISABLE_BENCHMARK
2018-12-15 12:54:31 +01:00
" D e f i n e s i f l i b e v e n t s h o u l d b u i l d w i t h o u t t h e b e n c h m a r k e x e c u t a b l e s " O F F )
2015-12-20 00:43:46 -08:00
option ( EVENT__DISABLE_TESTS
" I f t e s t s s h o u l d b e c o m p i l e d o r n o t " O F F )
option ( EVENT__DISABLE_REGRESS
" D i s a b l e t h e r e g r e s s t e s t s " O F F )
option ( EVENT__DISABLE_SAMPLES
" D i s a b l e s a m p l e f i l e s " O F F )
2016-10-03 03:17:18 +03:00
option ( EVENT__DISABLE_CLOCK_GETTIME
" D o n o t u s e c l o c k _ g e t t i m e e v e n i f i t i s a v a i l a b l e " O F F )
2015-12-20 00:43:46 -08:00
option ( EVENT__FORCE_KQUEUE_CHECK
2018-12-15 12:54:31 +01:00
" W h e n c r o s s c o m p i l i n g f o r c e s r u n n i n g a t e s t p r o g r a m t h a t v e r i f i e s t h a t K q u e u e w o r k s w i t h p i p e s . N o t e t h a t t h i s r e q u i r e s y o u t o m a n u a l l y r u n t h e t e s t p r o g r a m o n t h e c r o s s c o m p i l a t i o n t a r g e t t o v e r i f y t h a t i t w o r k s . S e e c m a k e d o c u m e n t a t i o n f o r t r y _ r u n f o r m o r e d e t a i l s " O F F )
2015-12-20 00:43:46 -08:00
2013-12-13 17:00:23 +01:00
# TODO: Add --disable-largefile omit support for large files
2015-12-20 00:43:46 -08:00
option ( EVENT__COVERAGE
" E n a b l e r u n n i n g g c o v t o g e t a t e s t c o v e r a g e report ( only works with GCC/CLang ) . M a k e s u r e t o e n a b l e - D C M A K E _ B U I L D _ T Y P E = D e b u g a s w e l l . " O F F )
2013-12-09 18:05:32 +01:00
# Put the libaries and binaries that get built into directories at the
2014-09-02 18:25:52 +04:00
# top of the build tree rather than in hard-to-find leaf directories.
2013-12-09 18:05:32 +01:00
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } /bin )
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } /lib )
set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } /lib )
2014-01-14 17:37:58 +01:00
if ( EVENT__ENABLE_VERBOSE_DEBUG )
2016-08-07 23:46:26 +03:00
add_definitions ( -DUSE_DEBUG=1 )
2014-01-14 17:37:58 +01:00
endif ( )
2018-10-17 11:14:48 +03:00
# make it colorful under ninja-build
if ( "${CMAKE_GENERATOR}" STREQUAL "Ninja" )
add_compiler_flags ( -fdiagnostics-color=always )
endif ( )
2013-12-17 15:17:29 +00:00
# Setup compiler flags for coverage.
if ( EVENT__COVERAGE )
2016-11-01 23:33:11 +03:00
if ( NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "debug" )
2015-12-20 00:43:46 -08:00
message ( FATAL_ERROR "Coverage requires -DCMAKE_BUILD_TYPE=Debug" )
2013-12-17 15:17:29 +00:00
endif ( )
2014-09-02 18:25:52 +04:00
2015-12-19 01:47:49 -08:00
message ( STATUS "Setting coverage compiler flags" )
2016-11-01 23:33:11 +03:00
set ( CMAKE_REQUIRED_LIBRARIES "--coverage" )
add_compiler_flags ( -g -O0 --coverage )
set ( CMAKE_REQUIRED_LIBRARIES "" )
2013-12-17 15:17:29 +00:00
endif ( )
2018-10-27 14:58:30 +03:00
set ( GNUC 0 )
set ( CLANG 0 )
2018-11-23 00:29:55 +03:00
set ( MSVC 0 )
2018-10-27 14:58:30 +03:00
if ( ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) OR
( " $ { C M A K E _ C _ C O M P I L E R _ I D } " S T R E Q U A L " A p p l e C l a n g " ) )
set ( CLANG 1 )
endif ( )
2018-11-23 00:29:55 +03:00
if ( ( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) OR ( ${ CLANG } ) )
2018-10-27 14:58:30 +03:00
set ( GNUC 1 )
endif ( )
2019-05-28 12:45:59 +00:00
if ( ( "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" ) OR ( "${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC" ) )
2018-11-23 00:29:55 +03:00
set ( MSVC 1 )
endif ( )
2018-10-27 14:58:30 +03:00
2018-11-22 23:00:11 +03:00
# Detect library type
set ( EVENT_LIBRARY_TYPE )
if ( "${EVENT__LIBRARY_TYPE}" STREQUAL "DEFAULT" )
2018-11-23 00:29:55 +03:00
if ( ${ MSVC } )
set ( EVENT_LIBRARY_TYPE SHARED )
else ( )
set ( EVENT_LIBRARY_TYPE BOTH )
endif ( )
2018-11-22 23:00:11 +03:00
else ( )
string ( TOUPPER "${EVENT__LIBRARY_TYPE}" EVENT_LIBRARY_TYPE )
endif ( )
2018-11-23 00:29:55 +03:00
if ( ( ${ MSVC } ) AND ( "${EVENT_LIBRARY_TYPE}" STREQUAL "BOTH" ) )
message ( WARNING
" B u i l d i n g S H A R E D a n d S T A T I C i s n o t s u p p o r t e d f o r MSVC "
" ( d u e t o c o n f l i c t s i n l i b r a r y n a m e "
" b e t w e e n S T A T I C l i b r a r y a n d I M P O R T E D l i b r a r y f o r S H A R E D l i b r a r i e s ) " )
endif ( )
2018-11-22 23:00:11 +03:00
set ( EVENT_LIBRARY_STATIC OFF )
set ( EVENT_LIBRARY_SHARED OFF )
if ( "${EVENT_LIBRARY_TYPE}" STREQUAL "BOTH" )
set ( EVENT_LIBRARY_STATIC ON )
set ( EVENT_LIBRARY_SHARED ON )
elseif ( "${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC" )
set ( EVENT_LIBRARY_STATIC ON )
elseif ( "${EVENT_LIBRARY_TYPE}" STREQUAL "SHARED" )
set ( EVENT_LIBRARY_SHARED ON )
else ( )
message ( FATAL_ERROR "${EVENT_LIBRARY_TYPE} is not supported" )
endif ( )
2018-12-17 21:31:54 +03:00
if ( ${ MSVC } )
set ( msvc_static_runtime OFF )
if ( "${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC" )
set ( msvc_static_runtime ON )
endif ( )
# For more info:
# - https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=vs-2017
# - https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-can-i-build-my-msvc-application-with-a-static-runtime
option ( EVENT__MSVC_STATIC_RUNTIME
" L i n k s t a t i c r u n t i m e l i b r a r i e s "
$ { m s v c _ s t a t i c _ r u n t i m e } )
if ( EVENT__MSVC_STATIC_RUNTIME )
foreach ( flag_var
C M A K E _ C _ F L A G S _ D E B U G
C M A K E _ C _ F L A G S _ R E L E A S E
C M A K E _ C _ F L A G S _ M I N S I Z E R E L
C M A K E _ C _ F L A G S _ R E L W I T H D E B I N F O
)
if ( ${ flag_var } MATCHES "/MD" )
string ( REGEX REPLACE "/MD" "/MT" ${ flag_var } "${${flag_var}}" )
endif ( )
endforeach ( )
endif ( )
endif ( )
2018-10-27 14:58:30 +03:00
# GNUC specific options.
if ( ${ GNUC } )
2013-12-13 17:00:23 +01:00
option ( EVENT__DISABLE_GCC_WARNINGS "Disable verbose warnings with GCC" OFF )
2015-12-19 01:47:49 -08:00
option ( EVENT__ENABLE_GCC_HARDENING "Enable compiler security checks" OFF )
option ( EVENT__ENABLE_GCC_FUNCTION_SECTIONS "Enable gcc function sections" OFF )
option ( EVENT__ENABLE_GCC_WARNINGS "Make all GCC warnings into errors" OFF )
2018-10-27 14:58:30 +03:00
set ( GCC_V ${ CMAKE_C_COMPILER_VERSION } )
list ( APPEND __FLAGS
2019-03-13 00:02:39 +03:00
- W a l l - W e x t r a - W n o - u n u s e d - p a r a m e t e r - W s t r i c t - a l i a s i n g - W s t r i c t - p r o t o t y p e s
2018-10-27 14:58:30 +03:00
- f n o - s t r i c t - a l i a s i n g # gcc 2.9.5+
2019-05-25 17:28:53 +03:00
- W m i s s i n g - p r o t o t y p e s
2018-10-27 14:58:30 +03:00
# gcc 4
- W i n i t - s e l f
- W m i s s i n g - f i e l d - i n i t i a l i z e r s
- W d e c l a r a t i o n - a f t e r - s t a t e m e n t
# gcc 4.2
- W a d d r e s s
- W n o r m a l i z e d = i d
- W o v e r r i d e - i n i t
# gcc 4.5
- W l o g i c a l - o p
2019-03-13 00:02:39 +03:00
2019-05-25 17:28:53 +03:00
- W w r i t e - s t r i n g s
2018-10-27 14:58:30 +03:00
)
2015-12-19 01:47:49 -08:00
2019-03-13 00:02:39 +03:00
if ( ${ CLANG } )
list ( APPEND __FLAGS -Wno-unused-function )
endif ( )
2013-12-13 17:00:23 +01:00
if ( EVENT__DISABLE_GCC_WARNINGS )
2016-03-10 00:33:04 +03:00
list ( APPEND __FLAGS -w )
2013-12-13 17:00:23 +01:00
endif ( )
if ( EVENT__ENABLE_GCC_HARDENING )
2016-03-10 00:33:04 +03:00
list ( APPEND __FLAGS
- f s t a c k - p r o t e c t o r - a l l
- f w r a p v
- f P I E
- W s t a c k - p r o t e c t o r
" - - p a r a m s s p - b u f f e r - s i z e = 1 " )
add_definitions ( -D_FORTIFY_SOURCE=2 )
2013-12-13 17:00:23 +01:00
endif ( )
if ( EVENT__ENABLE_GCC_FUNCTION_SECTIONS )
2016-03-10 00:33:04 +03:00
list ( APPEND __FLAGS -ffunction-sections )
2013-12-13 17:00:23 +01:00
# TODO: Add --gc-sections support. We need some checks for NetBSD to ensure this works.
endif ( )
2013-12-19 12:03:49 +00:00
if ( EVENT__ENABLE_GCC_WARNINGS )
2016-03-10 00:33:04 +03:00
list ( APPEND __FLAGS -Werror )
2013-12-19 12:03:49 +00:00
endif ( )
2016-03-10 00:33:04 +03:00
add_compiler_flags ( ${ __FLAGS } )
2013-12-13 17:00:23 +01:00
endif ( )
2013-12-17 13:28:23 +01:00
if ( APPLE )
# Get rid of deprecated warnings for OpenSSL on OSX 10.7 and greater.
2016-03-10 00:33:04 +03:00
add_compiler_flags (
- W n o - e r r o r = d e p r e c a t e d - d e c l a r a t i o n s
- Q u n u s e d - a r g u m e n t s
)
2013-12-17 13:28:23 +01:00
endif ( )
2013-12-09 18:05:32 +01:00
# Winsock.
if ( WIN32 )
set ( CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h )
2019-06-26 01:27:20 +03:00
set ( CMAKE_REQUIRED_LIBRARIES ws2_32.lib shell32.lib advapi32.lib )
2013-12-09 18:05:32 +01:00
set ( CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h )
endif ( )
2016-08-10 00:27:59 +03:00
if ( SOLARIS )
set ( CMAKE_REQUIRED_LIBRARIES socket nsl )
endif ( )
2013-12-09 18:05:32 +01:00
# Check if _GNU_SOURCE is available.
2018-11-04 19:48:11 +03:00
if ( NOT DEFINED _GNU_SOURCE )
2017-03-06 00:30:21 +03:00
CHECK_SYMBOL_EXISTS ( __GNU_LIBRARY__ "features.h" _GNU_SOURCE )
if ( NOT _GNU_SOURCE )
unset ( _GNU_SOURCE CACHE )
CHECK_SYMBOL_EXISTS ( _GNU_SOURCE "features.h" _GNU_SOURCE )
endif ( )
2019-07-08 14:06:55 -07:00
if ( ANDROID )
set ( _GNU_SOURCE TRUE )
endif ( )
2017-03-06 00:30:21 +03:00
endif ( )
2013-12-09 18:05:32 +01:00
if ( _GNU_SOURCE )
2019-02-25 11:59:15 -08:00
add_definitions ( -D_GNU_SOURCE=1 )
2013-12-09 18:05:32 +01:00
endif ( )
CHECK_INCLUDE_FILE ( sys/types.h EVENT__HAVE_SYS_TYPES_H )
if ( EVENT__HAVE_SYS_TYPES_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES sys/types.h )
endif ( )
CHECK_INCLUDE_FILE ( sys/socket.h EVENT__HAVE_SYS_SOCKET_H )
if ( EVENT__HAVE_SYS_SOCKET_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES sys/socket.h )
endif ( )
2019-09-03 00:34:35 +03:00
CHECK_INCLUDE_FILE ( sys/random.h EVENT__HAVE_SYS_RANDOM_H )
if ( EVENT__HAVE_SYS_RANDOM_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES sys/random.h )
endif ( )
2013-12-09 18:05:32 +01:00
CHECK_INCLUDE_FILE ( netinet/in.h EVENT__HAVE_NETINET_IN_H )
if ( EVENT__HAVE_NETINET_IN_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES netinet/in.h )
endif ( )
2019-05-12 16:12:06 +03:00
CHECK_INCLUDE_FILE ( sys/un.h EVENT__HAVE_SYS_UN_H )
if ( EVENT__HAVE_SYS_UN_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES sys/un.h )
endif ( )
if ( WIN32 )
CHECK_INCLUDE_FILE ( afunix.h EVENT__HAVE_AFUNIX_H )
if ( EVENT__HAVE_AFUNIX_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES afunix.h )
endif ( )
endif ( )
CHECK_TYPE_SIZE ( "struct sockaddr_un" EVENT__HAVE_STRUCT_SOCKADDR_UN )
2013-12-09 18:05:32 +01:00
CHECK_INCLUDE_FILE ( netinet/in6.h EVENT__HAVE_NETINET_IN6_H )
if ( EVENT__HAVE_NETINET_IN6_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES netinet/in6.h )
endif ( )
CHECK_INCLUDE_FILE ( unistd.h EVENT__HAVE_UNISTD_H )
CHECK_INCLUDE_FILE ( netdb.h EVENT__HAVE_NETDB_H )
CHECK_INCLUDE_FILE ( dlfcn.h EVENT__HAVE_DLFCN_H )
CHECK_INCLUDE_FILE ( arpa/inet.h EVENT__HAVE_ARPA_INET_H )
CHECK_INCLUDE_FILE ( fcntl.h EVENT__HAVE_FCNTL_H )
if ( EVENT__HAVE_FCNTL_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES fcntl.h )
endif ( )
CHECK_INCLUDE_FILE ( inttypes.h EVENT__HAVE_INTTYPES_H )
CHECK_INCLUDE_FILE ( memory.h EVENT__HAVE_MEMORY_H )
CHECK_INCLUDE_FILE ( poll.h EVENT__HAVE_POLL_H )
CHECK_INCLUDE_FILE ( port.h EVENT__HAVE_PORT_H )
if ( EVENT__HAVE_PORT_H )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES port.h )
endif ( )
CHECK_INCLUDE_FILE ( signal.h EVENT__HAVE_SIGNAL_H )
CHECK_INCLUDE_FILE ( stdarg.h EVENT__HAVE_STDARG_H )
CHECK_INCLUDE_FILE ( stddef.h EVENT__HAVE_STDDEF_H )
CHECK_INCLUDE_FILE ( stdint.h EVENT__HAVE_STDINT_H )
CHECK_INCLUDE_FILE ( stdlib.h EVENT__HAVE_STDLIB_H )
CHECK_INCLUDE_FILE ( strings.h EVENT__HAVE_STRINGS_H )
CHECK_INCLUDE_FILE ( string.h EVENT__HAVE_STRING_H )
2019-02-04 22:18:45 +03:00
CHECK_INCLUDE_FILE ( sys/devpoll.h EVENT__HAVE_DEVPOLL )
2013-12-09 18:05:32 +01:00
CHECK_INCLUDE_FILE ( sys/epoll.h EVENT__HAVE_SYS_EPOLL_H )
CHECK_INCLUDE_FILE ( sys/eventfd.h EVENT__HAVE_SYS_EVENTFD_H )
CHECK_INCLUDE_FILE ( sys/event.h EVENT__HAVE_SYS_EVENT_H )
CHECK_INCLUDE_FILE ( sys/ioctl.h EVENT__HAVE_SYS_IOCTL_H )
CHECK_INCLUDE_FILE ( sys/mman.h EVENT__HAVE_SYS_MMAN_H )
CHECK_INCLUDE_FILE ( sys/param.h EVENT__HAVE_SYS_PARAM_H )
CHECK_INCLUDE_FILE ( sys/queue.h EVENT__HAVE_SYS_QUEUE_H )
CHECK_INCLUDE_FILE ( sys/select.h EVENT__HAVE_SYS_SELECT_H )
CHECK_INCLUDE_FILE ( sys/sendfile.h EVENT__HAVE_SYS_SENDFILE_H )
CHECK_INCLUDE_FILE ( sys/stat.h EVENT__HAVE_SYS_STAT_H )
CHECK_INCLUDE_FILE ( sys/time.h EVENT__HAVE_SYS_TIME_H )
if ( EVENT__HAVE_SYS_TIME_H )
2013-12-16 18:10:32 +01:00
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES sys/time.h )
2013-12-09 18:05:32 +01:00
endif ( )
CHECK_INCLUDE_FILE ( sys/uio.h EVENT__HAVE_SYS_UIO_H )
CHECK_INCLUDE_FILES ( "sys/types.h;ifaddrs.h" EVENT__HAVE_IFADDRS_H )
CHECK_INCLUDE_FILE ( mach/mach_time.h EVENT__HAVE_MACH_MACH_TIME_H )
CHECK_INCLUDE_FILE ( netinet/tcp.h EVENT__HAVE_NETINET_TCP_H )
CHECK_INCLUDE_FILE ( sys/wait.h EVENT__HAVE_SYS_WAIT_H )
CHECK_INCLUDE_FILE ( sys/resource.h EVENT__HAVE_SYS_RESOURCE_H )
CHECK_INCLUDE_FILE ( sys/sysctl.h EVENT__HAVE_SYS_SYSCTL_H )
CHECK_INCLUDE_FILE ( sys/timerfd.h EVENT__HAVE_SYS_TIMERFD_H )
2016-06-28 10:37:24 -07:00
CHECK_INCLUDE_FILE ( errno.h EVENT__HAVE_ERRNO_H )
2013-12-09 18:05:32 +01:00
CHECK_FUNCTION_EXISTS_EX ( epoll_create EVENT__HAVE_EPOLL )
CHECK_FUNCTION_EXISTS_EX ( epoll_ctl EVENT__HAVE_EPOLL_CTL )
CHECK_FUNCTION_EXISTS_EX ( eventfd EVENT__HAVE_EVENTFD )
2016-10-03 03:17:18 +03:00
if ( NOT EVENT__DISABLE_CLOCK_GETTIME )
CHECK_FUNCTION_EXISTS_EX ( clock_gettime EVENT__HAVE_CLOCK_GETTIME )
endif ( )
2013-12-09 18:05:32 +01:00
CHECK_FUNCTION_EXISTS_EX ( fcntl EVENT__HAVE_FCNTL )
CHECK_FUNCTION_EXISTS_EX ( getaddrinfo EVENT__HAVE_GETADDRINFO )
CHECK_FUNCTION_EXISTS_EX ( getnameinfo EVENT__HAVE_GETNAMEINFO )
CHECK_FUNCTION_EXISTS_EX ( gettimeofday EVENT__HAVE_GETTIMEOFDAY )
CHECK_FUNCTION_EXISTS_EX ( getprotobynumber EVENT__HAVE_GETPROTOBYNUMBER )
CHECK_FUNCTION_EXISTS_EX ( getservbyname EVENT__HAVE_GETSERVBYNAME )
CHECK_FUNCTION_EXISTS_EX ( inet_ntop EVENT__HAVE_INET_NTOP )
CHECK_FUNCTION_EXISTS_EX ( inet_pton EVENT__HAVE_INET_PTON )
CHECK_FUNCTION_EXISTS_EX ( kqueue EVENT__HAVE_KQUEUE )
CHECK_FUNCTION_EXISTS_EX ( mmap EVENT__HAVE_MMAP )
CHECK_FUNCTION_EXISTS_EX ( pipe EVENT__HAVE_PIPE )
CHECK_FUNCTION_EXISTS_EX ( pipe2 EVENT__HAVE_PIPE2 )
CHECK_FUNCTION_EXISTS_EX ( poll EVENT__HAVE_POLL )
CHECK_FUNCTION_EXISTS_EX ( port_create EVENT__HAVE_PORT_CREATE )
CHECK_FUNCTION_EXISTS_EX ( sendfile EVENT__HAVE_SENDFILE )
CHECK_FUNCTION_EXISTS_EX ( sigaction EVENT__HAVE_SIGACTION )
CHECK_FUNCTION_EXISTS_EX ( signal EVENT__HAVE_SIGNAL )
2019-03-05 21:34:31 +03:00
CHECK_FUNCTION_EXISTS_EX ( strsignal EVENT__HAVE_STRSIGNAL )
2013-12-09 18:05:32 +01:00
CHECK_FUNCTION_EXISTS_EX ( splice EVENT__HAVE_SPLICE )
CHECK_FUNCTION_EXISTS_EX ( strlcpy EVENT__HAVE_STRLCPY )
CHECK_FUNCTION_EXISTS_EX ( strsep EVENT__HAVE_STRSEP )
CHECK_FUNCTION_EXISTS_EX ( strtok_r EVENT__HAVE_STRTOK_R )
CHECK_FUNCTION_EXISTS_EX ( strtoll EVENT__HAVE_STRTOLL )
CHECK_FUNCTION_EXISTS_EX ( vasprintf EVENT__HAVE_VASPRINTF )
CHECK_FUNCTION_EXISTS_EX ( sysctl EVENT__HAVE_SYSCTL )
CHECK_FUNCTION_EXISTS_EX ( accept4 EVENT__HAVE_ACCEPT4 )
CHECK_FUNCTION_EXISTS_EX ( arc4random EVENT__HAVE_ARC4RANDOM )
CHECK_FUNCTION_EXISTS_EX ( arc4random_buf EVENT__HAVE_ARC4RANDOM_BUF )
2017-03-06 00:55:16 +03:00
CHECK_FUNCTION_EXISTS_EX ( arc4random_addrandom EVENT__HAVE_ARC4RANDOM_ADDRANDOM )
2013-12-09 18:05:32 +01:00
CHECK_FUNCTION_EXISTS_EX ( epoll_create1 EVENT__HAVE_EPOLL_CREATE1 )
CHECK_FUNCTION_EXISTS_EX ( getegid EVENT__HAVE_GETEGID )
CHECK_FUNCTION_EXISTS_EX ( geteuid EVENT__HAVE_GETEUID )
CHECK_FUNCTION_EXISTS_EX ( getifaddrs EVENT__HAVE_GETIFADDRS )
CHECK_FUNCTION_EXISTS_EX ( issetugid EVENT__HAVE_ISSETUGID )
CHECK_FUNCTION_EXISTS_EX ( mach_absolute_time EVENT__HAVE_MACH_ABSOLUTE_TIME )
CHECK_FUNCTION_EXISTS_EX ( nanosleep EVENT__HAVE_NANOSLEEP )
CHECK_FUNCTION_EXISTS_EX ( usleep EVENT__HAVE_USLEEP )
CHECK_FUNCTION_EXISTS_EX ( timeradd EVENT__HAVE_TIMERADD )
CHECK_FUNCTION_EXISTS_EX ( timerclear EVENT__HAVE_TIMERCLEAR )
CHECK_FUNCTION_EXISTS_EX ( timercmp EVENT__HAVE_TIMERCMP )
2017-03-12 01:00:41 -08:00
CHECK_FUNCTION_EXISTS_EX ( timerfd_create EVENT__HAVE_TIMERFD_CREATE )
2013-12-09 18:05:32 +01:00
CHECK_FUNCTION_EXISTS_EX ( timerisset EVENT__HAVE_TIMERISSET )
CHECK_FUNCTION_EXISTS_EX ( putenv EVENT__HAVE_PUTENV )
CHECK_FUNCTION_EXISTS_EX ( setenv EVENT__HAVE_SETENV )
CHECK_FUNCTION_EXISTS_EX ( setrlimit EVENT__HAVE_SETRLIMIT )
CHECK_FUNCTION_EXISTS_EX ( umask EVENT__HAVE_UMASK )
CHECK_FUNCTION_EXISTS_EX ( unsetenv EVENT__HAVE_UNSETENV )
# Get the gethostbyname_r prototype.
CHECK_FUNCTION_EXISTS_EX ( gethostbyname_r EVENT__HAVE_GETHOSTBYNAME_R )
if ( EVENT__HAVE_GETHOSTBYNAME_R )
2014-09-02 18:25:52 +04:00
CHECK_PROTOTYPE_DEFINITION ( gethostbyname_r
2013-12-09 18:05:32 +01:00
" i n t gethostbyname_r ( const char *name, struct hostent *hp, struct hostent_data *hdata ) "
" 0 "
" n e t d b . h "
E V E N T _ _ H A V E _ G E T H O S T B Y N A M E _ R _ 3 _ A R G )
2014-09-02 18:25:52 +04:00
CHECK_PROTOTYPE_DEFINITION ( gethostbyname_r
2013-12-09 18:05:32 +01:00
" s t r u c t h o s t e n t * gethostbyname_r ( const char *name, struct hostent *hp, char *buf, size_t buflen, int *herr ) "
" N U L L "
" n e t d b . h "
E V E N T _ _ H A V E _ G E T H O S T B Y N A M E _ R _ 5 _ A R G )
2014-09-02 18:25:52 +04:00
CHECK_PROTOTYPE_DEFINITION ( gethostbyname_r
2013-12-09 18:05:32 +01:00
" i n t gethostbyname_r ( const char *name, struct hostent *hp, char *buf, size_t buflen, struct hostent **result, int *herr ) "
" 0 "
" n e t d b . h "
E V E N T _ _ H A V E _ G E T H O S T B Y N A M E _ R _ 6 _ A R G )
endif ( )
if ( HAVE_PORT_H AND HAVE_PORT_CREATE )
set ( EVENT__HAVE_EVENT_PORTS 1 )
endif ( )
if ( NOT WIN32 )
2013-12-16 18:10:32 +01:00
CHECK_FUNCTION_EXISTS_EX ( select EVENT__HAVE_SELECT )
2013-12-09 18:05:32 +01:00
endif ( )
2019-09-19 15:24:51 +08:00
if ( WIN32 )
CHECK_FUNCTION_EXISTS_EX ( _gmtime64_s EVENT__HAVE__GMTIME64_S )
if ( NOT EVENT__HAVE__GMTIME64_S )
CHECK_FUNCTION_EXISTS_EX ( _gmtime64 EVENT__HAVE__GMTIME64 )
endif ( )
endif ( )
2013-12-09 18:05:32 +01:00
CHECK_TYPE_SIZE ( "uint8_t" EVENT__HAVE_UINT8_T )
CHECK_TYPE_SIZE ( "uint16_t" EVENT__HAVE_UINT16_T )
CHECK_TYPE_SIZE ( "uint32_t" EVENT__HAVE_UINT32_T )
CHECK_TYPE_SIZE ( "uint64_t" EVENT__HAVE_UINT64_T )
CHECK_TYPE_SIZE ( "short" EVENT__SIZEOF_SHORT BUILTIN_TYPES_ONLY )
CHECK_TYPE_SIZE ( "int" EVENT__SIZEOF_INT BUILTIN_TYPES_ONLY )
CHECK_TYPE_SIZE ( "unsigned" EVENT__SIZEOF_UNSIGNED BUILTIN_TYPES_ONLY )
CHECK_TYPE_SIZE ( "unsigned int" EVENT__SIZEOF_UNSIGNED_INT BUILTIN_TYPES_ONLY )
CHECK_TYPE_SIZE ( "long" EVENT__SIZEOF_LONG BUILTIN_TYPES_ONLY )
CHECK_TYPE_SIZE ( "long long" EVENT__SIZEOF_LONG_LONG BUILTIN_TYPES_ONLY )
if ( WIN32 )
2013-12-16 18:10:32 +01:00
# These aren't available until Windows Vista.
# But you can still link them. They just won't be found when running the exe.
set ( EVENT__HAVE_INET_NTOP 0 )
set ( EVENT__HAVE_INET_PTON 0 )
2013-12-09 18:05:32 +01:00
endif ( )
# Check for different inline keyword versions.
2015-12-19 01:47:49 -08:00
check_function_keywords ( "inline" "__inline" "__inline__" )
if ( HAVE_INLINE )
2018-06-19 10:15:08 +03:00
set ( EVENT__inline inline )
2015-12-19 01:47:49 -08:00
elseif ( HAVE___INLINE )
2015-12-20 00:43:46 -08:00
set ( EVENT__inline __inline )
2015-12-19 01:47:49 -08:00
elseif ( HAVE___INLINE__ )
2015-12-20 00:43:46 -08:00
set ( EVENT__inline __inline__ )
2015-12-19 01:47:49 -08:00
else ( )
2015-12-20 00:43:46 -08:00
set ( EVENT__inline )
2013-12-09 18:05:32 +01:00
endif ( )
2018-06-19 10:15:08 +03:00
# __func__/__FUNCTION__ is not a macros in general
CHECK_SYMBOL_EXISTS ( "__func__" "" EVENT__HAVE___func__ )
CHECK_SYMBOL_EXISTS ( "__FUNCTION__" "" EVENT__HAVE___FUNCTION__ )
2013-12-09 18:05:32 +01:00
CHECK_SYMBOL_EXISTS ( TAILQ_FOREACH sys/queue.h EVENT__HAVE_TAILQFOREACH )
2017-01-30 03:17:41 +03:00
CHECK_CONST_EXISTS ( CTL_KERN sys/sysctl.h EVENT__HAVE_DECL_CTL_KERN )
CHECK_CONST_EXISTS ( KERN_ARND sys/sysctl.h EVENT__HAVE_DECL_KERN_ARND )
2013-12-09 18:05:32 +01:00
CHECK_SYMBOL_EXISTS ( F_SETFD fcntl.h EVENT__HAVE_SETFD )
2019-09-03 00:34:35 +03:00
CHECK_FUNCTION_EXISTS_EX ( getrandom EVENT__HAVE_GETRANDOM )
2013-12-09 18:05:32 +01:00
CHECK_TYPE_SIZE ( fd_mask EVENT__HAVE_FD_MASK )
2015-12-19 01:47:49 -08:00
2017-12-16 23:28:41 +03:00
CHECK_TYPE_SIZE ( size_t EVENT__SIZEOF_SIZE_T )
2013-12-09 18:05:32 +01:00
if ( NOT EVENT__SIZEOF_SIZE_T )
2015-12-20 21:44:04 -08:00
set ( EVENT__size_t "unsigned" )
2013-12-09 18:05:32 +01:00
set ( EVENT__SIZEOF_SIZE_T ${ EVENT__SIZEOF_UNSIGNED } )
2015-12-19 01:47:49 -08:00
else ( )
2015-12-20 21:44:04 -08:00
set ( EVENT__size_t size_t )
2013-12-09 18:05:32 +01:00
endif ( )
2015-12-21 04:36:24 -08:00
CHECK_TYPE_SIZE ( "off_t" EVENT__SIZEOF_OFF_T LANGUAGE C )
2013-12-09 18:05:32 +01:00
2015-12-21 04:36:24 -08:00
# XXX we should functionalize these size and type sets. --elley
# Winssck.
2016-01-07 17:51:40 +03:00
if ( _MSC_VER )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES BaseTsd.h )
endif ( )
CHECK_TYPE_SIZE ( "ssize_t" EVENT__SIZEOF_SSIZE_T_LOWER LANGUAGE C )
CHECK_TYPE_SIZE ( "SSIZE_T" EVENT__SIZEOF_SSIZE_T_UPPER LANGUAGE C )
if ( EVENT__SIZEOF_SSIZE_T_LOWER )
set ( EVENT__ssize_t "ssize_t" )
2016-08-24 16:19:01 +08:00
set ( EVENT__SIZEOF_SSIZE_T ${ EVENT__SIZEOF_SSIZE_T_LOWER } )
2016-01-07 17:51:40 +03:00
elseif ( EVENT__SIZEOF_SSIZE_T_UPPER )
set ( EVENT__ssize_t "SSIZE_T" )
2016-08-24 16:19:01 +08:00
set ( EVENT__SIZEOF_SSIZE_T ${ EVENT__SIZEOF_SSIZE_T_UPPER } )
2016-01-07 17:51:40 +03:00
else ( )
set ( EVENT__ssize_t "int" )
set ( EVENT__SIZEOF_SSIZE_T ${ EVENT__SIZEOF_INT } )
2013-12-09 18:05:32 +01:00
endif ( )
CHECK_TYPE_SIZE ( socklen_t EVENT__SIZEOF_SOCKLEN_T )
if ( NOT EVENT__SIZEOF_SOCKLEN_T )
set ( EVENT__socklen_t "unsigned int" )
set ( EVENT__SIZEOF_SOCKLEN_T ${ EVENT__SIZEOF_UNSIGNED_INT } )
2015-12-19 01:47:49 -08:00
else ( )
2015-12-20 00:43:46 -08:00
set ( EVENT__socklen_t "socklen_t" )
2013-12-09 18:05:32 +01:00
endif ( )
CHECK_TYPE_SIZE ( pid_t EVENT__SIZEOF_PID_T )
if ( NOT EVENT__SIZEOF_PID_T )
set ( EVENT__SIZEOF_PID_T ${ EVENT__SIZEOF_INT } )
2015-12-20 21:44:04 -08:00
else ( )
set ( EVENT__SIZEOF_PID_T EVENT__SIZEOF_PID_T )
2013-12-09 18:05:32 +01:00
endif ( )
2015-12-19 01:47:49 -08:00
if ( NOT EVENT__DISABLE_THREAD_SUPPORT )
2017-03-13 22:02:45 +03:00
if ( NOT WIN32 )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES pthread.h )
endif ( )
2015-12-20 00:43:46 -08:00
CHECK_TYPE_SIZE ( pthread_t EVENT__SIZEOF_PTHREAD_T )
2015-12-19 01:47:49 -08:00
endif ( )
2013-12-09 18:05:32 +01:00
if ( EVENT__HAVE_CLOCK_GETTIME )
set ( EVENT__DNS_USE_CPU_CLOCK_FOR_ID 1 )
endif ( )
2015-12-21 04:36:24 -08:00
# we're just getting lazy now.
2013-12-09 18:05:32 +01:00
CHECK_TYPE_SIZE ( "uintptr_t" EVENT__HAVE_UINTPTR_T )
CHECK_TYPE_SIZE ( "void *" EVENT__SIZEOF_VOID_P )
2017-09-01 15:50:36 -07:00
CHECK_TYPE_SIZE ( "time_t" EVENT__SIZEOF_TIME_T )
2013-12-09 18:05:32 +01:00
# Tests file offset bits.
# TODO: Add AIX test for if -D_LARGE_FILES is needed.
2015-12-19 01:47:49 -08:00
# XXX: Why is this here? we don't even use it. Well, we don't even use it
# on top of that, why is it set in the config.h?! IT_MAKES_NO_SENSE
# I'm commenting it out for now.
# - ellzey
#CHECK_FILE_OFFSET_BITS()
2013-12-09 18:05:32 +01:00
2013-12-17 14:01:21 +01:00
# Verify kqueue works with pipes.
2013-12-17 13:29:04 +01:00
if ( EVENT__HAVE_KQUEUE )
2019-07-02 10:47:47 -07:00
if ( ( CMAKE_CROSSCOMPILING OR APPLE ) AND NOT EVENT__FORCE_KQUEUE_CHECK )
2013-12-17 14:01:21 +01:00
message ( WARNING "Cannot check if kqueue works with pipes when crosscompiling, use EVENT__FORCE_KQUEUE_CHECK to be sure (this requires manually running a test program on the cross compilation target)" )
set ( EVENT__HAVE_WORKING_KQUEUE 1 )
else ( )
2015-12-19 01:47:49 -08:00
message ( STATUS "Checking if kqueue works with pipes..." )
2013-12-17 14:01:21 +01:00
include ( CheckWorkingKqueue )
endif ( )
2013-12-17 13:29:04 +01:00
endif ( )
2013-12-09 18:05:32 +01:00
if ( EVENT__HAVE_NETDB_H )
2013-12-16 18:10:32 +01:00
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES netdb.h )
CHECK_TYPE_SIZE ( "struct addrinfo" EVENT__HAVE_STRUCT_ADDRINFO )
2013-12-09 18:05:32 +01:00
elseif ( WIN32 )
2013-12-16 18:10:32 +01:00
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES ws2tcpip.h )
CHECK_TYPE_SIZE ( "struct addrinfo" EVENT__HAVE_STRUCT_ADDRINFO )
2013-12-09 18:05:32 +01:00
endif ( )
# Check for sockaddr structure sizes.
set ( SOCKADDR_HEADERS )
if ( WIN32 )
set ( CMAKE_REQUIRED_DEFINITIONS "-DWIN32_LEAN_AND_MEAN" )
if ( _MSC_VER LESS 1300 )
set ( SOCKADDR_HEADERS winsock.h )
else ( )
set ( SOCKADDR_HEADERS winsock2.h ws2tcpip.h )
endif ( )
else ( )
if ( EVENT__HAVE_NETINET_IN_H )
set ( SOCKADDR_HEADERS ${ SOCKADDR_HEADERS } netinet/in.h )
endif ( )
if ( EVENT__HAVE_NETINET_IN6_H )
set ( SOCKADDR_HEADERS ${ SOCKADDR_HEADERS } netinet/in6.h )
endif ( )
if ( EVENT__HAVE_SYS_SOCKET_H )
set ( SOCKADDR_HEADERS ${ SOCKADDR_HEADERS } sys/socket.h )
endif ( )
if ( EVENT__HAVE_NETDB_H )
set ( SOCKADDR_HEADERS ${ SOCKADDR_HEADERS } netdb.h )
endif ( )
endif ( )
CHECK_TYPE_SIZE ( "struct in6_addr" EVENT__HAVE_STRUCT_IN6_ADDR )
if ( EVENT__HAVE_STRUCT_IN6_ADDR )
2015-12-20 00:43:46 -08:00
CHECK_STRUCT_HAS_MEMBER ( "struct in6_addr"
s 6 _ a d d r 1 6 " $ { S O C K A D D R _ H E A D E R S } "
E V E N T _ _ H A V E _ S T R U C T _ I N 6 _ A D D R _ S 6 _ A D D R 1 6 )
CHECK_STRUCT_HAS_MEMBER ( "struct in6_addr"
s 6 _ a d d r 3 2 " $ { S O C K A D D R _ H E A D E R S } "
E V E N T _ _ H A V E _ S T R U C T _ I N 6 _ A D D R _ S 6 _ A D D R 3 2 )
2013-12-09 18:05:32 +01:00
endif ( )
CHECK_TYPE_SIZE ( "sa_family_t" EVENT__HAVE_SA_FAMILY_T )
CHECK_TYPE_SIZE ( "struct sockaddr_in6" EVENT__HAVE_STRUCT_SOCKADDR_IN6 )
2015-12-20 00:43:46 -08:00
2013-12-09 18:05:32 +01:00
if ( EVENT__HAVE_STRUCT_SOCKADDR_IN6 )
2015-12-20 00:43:46 -08:00
CHECK_STRUCT_HAS_MEMBER ( "struct sockaddr_in6"
s i n 6 _ l e n " $ { S O C K A D D R _ H E A D E R S } "
E V E N T _ _ H A V E _ S T R U C T _ S O C K A D D R _ I N 6 _ S I N 6 _ L E N )
CHECK_STRUCT_HAS_MEMBER ( "struct sockaddr_in6"
s i n _ l e n " $ { S O C K A D D R _ H E A D E R S } "
E V E N T _ _ H A V E _ S T R U C T _ S O C K A D D R _ I N _ S I N _ L E N )
2013-12-09 18:05:32 +01:00
endif ( )
CHECK_TYPE_SIZE ( "struct sockaddr_storage" EVENT__HAVE_STRUCT_SOCKADDR_STORAGE )
if ( EVENT__HAVE_STRUCT_SOCKADDR_STORAGE )
2015-12-20 00:43:46 -08:00
CHECK_STRUCT_HAS_MEMBER ( "struct sockaddr_storage"
s s _ f a m i l y " $ { S O C K A D D R _ H E A D E R S } "
E V E N T _ _ H A V E _ S T R U C T _ S O C K A D D R _ S T O R A G E _ S S _ F A M I L Y )
CHECK_STRUCT_HAS_MEMBER ( "struct sockaddr_storage"
_ _ s s _ f a m i l y " $ { S O C K A D D R _ H E A D E R S } " E V E N T _ _ H A V E _ S T R U C T _ S O C K A D D R _ S T O R A G E _ _ _ S S _ F A M I L Y )
2013-12-09 18:05:32 +01:00
endif ( )
2017-01-29 23:05:18 +03:00
CHECK_TYPE_SIZE ( "struct linger" EVENT__HAVE_STRUCT_LINGER )
2013-12-09 18:05:32 +01:00
# Group the source files.
set ( HDR_PRIVATE
b u f f e r e v e n t - i n t e r n a l . h
c h a n g e l i s t - i n t e r n a l . h
d e f e r - i n t e r n a l . h
2014-01-21 15:47:44 -05:00
e p o l l t a b l e - i n t e r n a l . h
2013-12-09 18:05:32 +01:00
e v b u f f e r - i n t e r n a l . h
e v e n t - i n t e r n a l . h
e v m a p - i n t e r n a l . h
e v r p c - i n t e r n a l . h
e v s i g n a l - i n t e r n a l . h
e v t h r e a d - i n t e r n a l . h
h t - i n t e r n a l . h
h t t p - i n t e r n a l . h
i o c p - i n t e r n a l . h
i p v 6 - i n t e r n a l . h
l o g - i n t e r n a l . h
m i n h e a p - i n t e r n a l . h
m m - i n t e r n a l . h
r a t e l i m - i n t e r n a l . h
s t r l c p y - i n t e r n a l . h
u t i l - i n t e r n a l . h
e v c o n f i g - p r i v a t e . h
2015-12-20 00:43:46 -08:00
c o m p a t / s y s / q u e u e . h )
2014-09-02 18:25:52 +04:00
set ( HDR_COMPAT
i n c l u d e / e v d n s . h
i n c l u d e / e v r p c . h
i n c l u d e / e v e n t . h
i n c l u d e / e v h t t p . h
2015-12-20 00:43:46 -08:00
i n c l u d e / e v u t i l . h )
2014-09-02 18:25:52 +04:00
2013-12-09 18:05:32 +01:00
set ( HDR_PUBLIC
i n c l u d e / e v e n t 2 / b u f f e r . h
i n c l u d e / e v e n t 2 / b u f f e r e v e n t . h
i n c l u d e / e v e n t 2 / b u f f e r e v e n t _ c o m p a t . h
i n c l u d e / e v e n t 2 / b u f f e r e v e n t _ s t r u c t . h
i n c l u d e / e v e n t 2 / b u f f e r _ c o m p a t . h
i n c l u d e / e v e n t 2 / d n s . h
i n c l u d e / e v e n t 2 / d n s _ c o m p a t . h
i n c l u d e / e v e n t 2 / d n s _ s t r u c t . h
i n c l u d e / e v e n t 2 / e v e n t . h
i n c l u d e / e v e n t 2 / e v e n t _ c o m p a t . h
i n c l u d e / e v e n t 2 / e v e n t _ s t r u c t . h
2019-03-26 13:33:57 -04:00
i n c l u d e / e v e n t 2 / w a t c h . h
2013-12-09 18:05:32 +01:00
i n c l u d e / e v e n t 2 / h t t p . h
i n c l u d e / e v e n t 2 / h t t p _ c o m p a t . h
i n c l u d e / e v e n t 2 / h t t p _ s t r u c t . h
2014-03-24 15:01:02 +01:00
i n c l u d e / e v e n t 2 / k e y v a l q _ s t r u c t . h
2013-12-09 18:05:32 +01:00
i n c l u d e / e v e n t 2 / l i s t e n e r . h
i n c l u d e / e v e n t 2 / r p c . h
i n c l u d e / e v e n t 2 / r p c _ c o m p a t . h
i n c l u d e / e v e n t 2 / r p c _ s t r u c t . h
i n c l u d e / e v e n t 2 / t a g . h
i n c l u d e / e v e n t 2 / t a g _ c o m p a t . h
i n c l u d e / e v e n t 2 / t h r e a d . h
i n c l u d e / e v e n t 2 / u t i l . h
2014-03-21 12:12:10 +01:00
i n c l u d e / e v e n t 2 / v i s i b i l i t y . h
2015-12-20 00:43:46 -08:00
$ { P R O J E C T _ B I N A R Y _ D I R } / i n c l u d e / e v e n t 2 / e v e n t - c o n f i g . h )
2013-12-09 18:05:32 +01:00
set ( SRC_CORE
2014-09-02 18:25:52 +04:00
b u f f e r . c
b u f f e r e v e n t . c
b u f f e r e v e n t _ f i l t e r . c
b u f f e r e v e n t _ p a i r . c
b u f f e r e v e n t _ r a t e l i m . c
b u f f e r e v e n t _ s o c k . c
e v e n t . c
e v m a p . c
e v t h r e a d . c
e v u t i l . c
2013-12-09 18:05:32 +01:00
e v u t i l _ r a n d . c
2013-12-16 18:10:32 +01:00
e v u t i l _ t i m e . c
2019-03-26 13:33:57 -04:00
w a t c h . c
2014-09-02 18:25:52 +04:00
l i s t e n e r . c
l o g . c
s i g n a l . c
2015-12-20 00:43:46 -08:00
s t r l c p y . c )
2013-12-09 18:05:32 +01:00
if ( EVENT__HAVE_SELECT )
list ( APPEND SRC_CORE select.c )
endif ( )
if ( EVENT__HAVE_POLL )
list ( APPEND SRC_CORE poll.c )
endif ( )
if ( EVENT__HAVE_KQUEUE )
list ( APPEND SRC_CORE kqueue.c )
endif ( )
if ( EVENT__HAVE_DEVPOLL )
list ( APPEND SRC_CORE devpoll.c )
endif ( )
if ( EVENT__HAVE_EPOLL )
2017-03-08 23:15:33 +03:00
list ( APPEND SRC_CORE epoll.c )
2013-12-09 18:05:32 +01:00
endif ( )
if ( EVENT__HAVE_EVENT_PORTS )
list ( APPEND SRC_CORE evport.c )
endif ( )
if ( NOT EVENT__DISABLE_OPENSSL )
find_package ( OpenSSL REQUIRED )
2015-12-20 00:43:46 -08:00
2013-12-12 16:33:20 +01:00
set ( EVENT__HAVE_OPENSSL 1 )
2015-12-20 00:43:46 -08:00
2015-12-19 01:47:49 -08:00
message ( STATUS "OpenSSL include: ${OPENSSL_INCLUDE_DIR}" )
message ( STATUS "OpenSSL lib: ${OPENSSL_LIBRARIES}" )
2015-12-20 00:43:46 -08:00
2013-12-12 16:33:20 +01:00
include_directories ( ${ OPENSSL_INCLUDE_DIR } )
2015-12-20 00:43:46 -08:00
2016-11-07 00:46:45 +03:00
list ( APPEND SRC_OPENSSL bufferevent_openssl.c )
2013-12-12 16:33:20 +01:00
list ( APPEND HDR_PUBLIC include/event2/bufferevent_ssl.h )
2013-12-13 17:00:23 +01:00
list ( APPEND LIB_APPS ${ OPENSSL_LIBRARIES } )
2013-12-09 18:05:32 +01:00
endif ( )
2013-12-12 16:33:20 +01:00
if ( NOT EVENT__DISABLE_THREAD_SUPPORT )
if ( WIN32 )
list ( APPEND SRC_CORE evthread_win32.c )
else ( )
find_package ( Threads REQUIRED )
if ( NOT CMAKE_USE_PTHREADS_INIT )
2015-12-20 00:43:46 -08:00
message ( FATAL_ERROR
2016-11-07 00:46:45 +03:00
" F a i l e d t o f i n d P t h r e a d s , s e t E V E N T _ _ D I S A B L E _ T H R E A D _ S U P P O R T t o d i s a b l e " )
2013-12-12 16:33:20 +01:00
endif ( )
2015-12-20 00:43:46 -08:00
2013-12-12 16:33:20 +01:00
set ( EVENT__HAVE_PTHREADS 1 )
2013-12-13 17:00:23 +01:00
list ( APPEND LIB_APPS ${ CMAKE_THREAD_LIBS_INIT } )
2013-12-12 16:33:20 +01:00
endif ( )
2013-12-09 18:05:32 +01:00
endif ( )
2013-12-19 10:46:04 +00:00
if ( NOT EVENT__DISABLE_TESTS )
# Zlib is only used for testing.
find_package ( ZLIB )
2016-08-09 10:56:34 +03:00
if ( ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR )
2015-12-20 00:43:46 -08:00
include_directories ( ${ ZLIB_INCLUDE_DIRS } )
2016-08-24 16:19:01 +08:00
set ( EVENT__HAVE_LIBZ 1 )
2013-12-19 10:46:04 +00:00
list ( APPEND LIB_APPS ${ ZLIB_LIBRARIES } )
endif ( )
2013-12-09 18:05:32 +01:00
endif ( )
set ( SRC_EXTRA
2014-09-02 18:25:52 +04:00
e v e n t _ t a g g i n g . c
h t t p . c
e v d n s . c
2015-12-20 00:43:46 -08:00
e v r p c . c )
2013-12-09 18:05:32 +01:00
add_definitions ( -DHAVE_CONFIG_H )
2014-01-21 11:19:02 +01:00
# We use BEFORE here so we don't accidentally look in system directories
# first for some previous versions of the headers that are installed.
include_directories ( BEFORE ${ PROJECT_SOURCE_DIR }
$ { P R O J E C T _ S O U R C E _ D I R } / c o m p a t
$ { P R O J E C T _ S O U R C E _ D I R } / i n c l u d e )
2013-12-09 18:05:32 +01:00
if ( WIN32 )
2014-09-02 18:25:52 +04:00
list ( APPEND SRC_CORE
b u f f e r _ i o c p . c
2013-12-09 18:05:32 +01:00
b u f f e r e v e n t _ a s y n c . c
2014-09-02 18:25:52 +04:00
e v e n t _ i o c p . c
2015-12-20 00:43:46 -08:00
w i n 3 2 s e l e c t . c )
2014-09-02 18:25:52 +04:00
2013-12-12 16:33:20 +01:00
list ( APPEND HDR_PRIVATE WIN32-Code/getopt.h )
2013-12-09 18:05:32 +01:00
set ( EVENT__DNS_USE_FTIME_FOR_ID 1 )
2019-06-26 01:27:20 +03:00
set ( LIB_PLATFORM ws2_32 shell32 advapi32 )
2015-12-20 00:43:46 -08:00
add_definitions (
- D _ C R T _ S E C U R E _ N O _ W A R N I N G S
- D _ C R T _ N O N S T D C _ N O _ D E P R E C A T E )
2013-12-13 12:39:50 +00:00
include_directories ( ./WIN32-Code )
endif ( )
2016-08-10 00:16:48 +03:00
if ( SOLARIS )
list ( APPEND LIB_PLATFORM socket nsl )
endif ( )
2013-12-09 18:05:32 +01:00
source_group ( "Headers Private" FILES ${ HDR_PRIVATE } )
2014-09-02 18:25:52 +04:00
source_group ( "Header Compat" FILES ${ HDR_COMPAT } )
2013-12-09 18:05:32 +01:00
source_group ( "Headers Public" FILES ${ HDR_PUBLIC } )
source_group ( "Source Core" FILES ${ SRC_CORE } )
source_group ( "Source Extra" FILES ${ SRC_EXTRA } )
2013-12-13 11:34:22 +01:00
# Generate the configure headers.
# (Place them in the build dir so we don't polute the source tree with generated files).
2014-01-21 11:19:02 +01:00
include_directories ( BEFORE ${ CMAKE_CURRENT_BINARY_DIR } /include )
2013-12-13 11:34:22 +01:00
2018-10-27 14:58:30 +03:00
if ( ${ GNUC } )
2017-03-12 23:31:59 +03:00
set ( EVENT_SHARED_FLAGS -fvisibility=hidden )
elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro" )
set ( EVENT_SHARED_FLAGS -xldscope=hidden )
endif ( )
2014-02-19 06:31:27 +01:00
2013-12-09 18:05:32 +01:00
configure_file (
2014-02-19 06:31:27 +01:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / e v e n t - c o n f i g . h . c m a k e
2015-12-19 01:47:49 -08:00
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n c l u d e / e v e n t 2 / e v e n t - c o n f i g . h
2015-12-20 00:43:46 -08:00
N E W L I N E _ S T Y L E UNIX )
2013-12-13 11:34:22 +01:00
configure_file (
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / e v c o n f i g - p r i v a t e . h . c m a k e
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n c l u d e / e v c o n f i g - p r i v a t e . h )
2013-12-09 18:05:32 +01:00
2014-01-09 13:44:38 +01:00
#
# Create the libraries.
#
2017-03-12 23:31:59 +03:00
include ( AddEventLibrary )
add_event_library ( event_core SOURCES ${ SRC_CORE } )
2017-03-13 15:49:11 +03:00
add_event_library ( event_extra
L I B R A R I E S e v e n t _ c o r e _ s h a r e d
S O U R C E S $ { S R C _ E X T R A } )
2016-11-07 00:46:45 +03:00
if ( NOT EVENT__DISABLE_OPENSSL )
2017-03-12 23:31:59 +03:00
add_event_library ( event_openssl
2017-03-13 15:49:11 +03:00
L I B R A R I E S e v e n t _ c o r e _ s h a r e d $ { O P E N S S L _ L I B R A R I E S }
2017-03-12 23:31:59 +03:00
S O U R C E S $ { S R C _ O P E N S S L } )
2016-11-07 00:46:45 +03:00
endif ( )
if ( CMAKE_USE_PTHREADS_INIT )
set ( SRC_PTHREADS evthread_pthread.c )
2017-03-13 15:49:11 +03:00
add_event_library ( event_pthreads
L I B R A R I E S e v e n t _ c o r e _ s h a r e d
S O U R C E S $ { S R C _ P T H R E A D S } )
2016-11-07 00:46:45 +03:00
endif ( )
2013-12-12 16:33:20 +01:00
2014-02-19 06:29:58 +01:00
# library exists for historical reasons; it contains the contents of
# both libevent_core and libevent_extra. You shouldn’ t use it; it may
# go away in a future version of Libevent.
2017-03-12 23:31:59 +03:00
add_event_library ( event SOURCES ${ SRC_CORE } ${ SRC_EXTRA } )
2014-02-19 06:31:27 +01:00
2017-05-29 16:32:30 +03:00
set ( WIN32_GETOPT )
if ( WIN32 )
list ( APPEND WIN32_GETOPT
WIN32 - C o d e / g e t o p t . c
WIN32 - C o d e / g e t o p t _ l o n g . c )
endif ( )
2014-01-09 13:44:38 +01:00
#
# Samples.
#
2016-11-07 00:46:45 +03:00
macro ( add_sample_prog ssl name )
2017-03-12 23:31:59 +03:00
add_executable ( ${ name } ${ ARGN } )
target_link_libraries ( ${ name }
2018-11-22 23:00:11 +03:00
e v e n t _ e x t r a
e v e n t _ c o r e
2017-03-12 23:31:59 +03:00
$ { L I B _ A P P S }
$ { L I B _ P L A T F O R M } )
if ( ${ ssl } )
2018-11-22 23:00:11 +03:00
target_link_libraries ( ${ name } event_openssl )
2019-09-15 21:45:26 +08:00
if ( WIN32 )
target_link_libraries ( ${ name } crypt32 )
endif ( )
2017-03-12 23:31:59 +03:00
endif ( )
2016-11-07 00:46:45 +03:00
endmacro ( )
2013-12-12 16:33:20 +01:00
if ( NOT EVENT__DISABLE_SAMPLES )
2013-12-13 17:00:23 +01:00
set ( SAMPLES
e v e n t - r e a d - f i f o
h e l l o - w o r l d
s i g n a l - t e s t
2015-08-18 12:18:31 +03:00
h t t p - c o n n e c t
2019-03-26 13:33:57 -04:00
t i m e - t e s t
w a t c h - t i m i n g )
2013-12-13 17:00:23 +01:00
foreach ( SAMPLE ${ SAMPLES } )
2016-11-07 00:46:45 +03:00
add_sample_prog ( OFF ${ SAMPLE } sample/ ${ SAMPLE } .c )
2013-12-13 17:00:23 +01:00
endforeach ( )
2019-03-26 13:33:57 -04:00
if ( NOT WIN32 )
target_link_libraries ( watch-timing m )
endif ( )
2016-01-12 01:57:07 +03:00
2016-11-07 00:46:45 +03:00
if ( NOT EVENT__DISABLE_OPENSSL )
add_sample_prog ( ON https-client
s a m p l e / h t t p s - c l i e n t . c
s a m p l e / o p e n s s l _ h o s t n a m e _ v a l i d a t i o n . c
s a m p l e / h o s t c h e c k . c )
add_sample_prog ( ON le-proxy
s a m p l e / l e - p r o x y . c )
2019-03-05 21:34:31 +03:00
add_sample_prog ( ON becat sample/becat.c ${ WIN32_GETOPT } )
2016-11-07 00:46:45 +03:00
endif ( )
2018-11-13 10:48:41 +03:00
set ( SAMPLES_WOPT
d n s - e x a m p l e
h t t p - s e r v e r
)
foreach ( SAMPLE ${ SAMPLES_WOPT } )
add_sample_prog ( OFF ${ SAMPLE } sample/ ${ SAMPLE } .c ${ WIN32_GETOPT } )
endforeach ( )
2013-12-12 16:33:20 +01:00
endif ( )
2013-12-09 18:05:32 +01:00
2016-11-07 00:46:45 +03:00
#
# Benchmarks
#
macro ( add_bench_prog prog )
2017-05-29 16:36:24 +03:00
add_executable ( ${ prog } ${ ARGN } )
target_link_libraries ( ${ prog }
2018-11-22 23:00:11 +03:00
e v e n t _ e x t r a
e v e n t _ c o r e
2016-11-07 00:46:45 +03:00
$ { L I B _ A P P S }
$ { L I B _ P L A T F O R M } )
endmacro ( )
2013-12-09 18:05:32 +01:00
if ( NOT EVENT__DISABLE_BENCHMARK )
2017-05-29 16:36:24 +03:00
foreach ( BENCHMARK bench_http bench_httpclient )
add_bench_prog ( ${ BENCHMARK } test/ ${ BENCHMARK } .c )
2013-12-12 16:33:20 +01:00
endforeach ( )
2017-05-29 16:36:24 +03:00
add_bench_prog ( bench test/bench.c ${ WIN32_GETOPT } )
add_bench_prog ( bench_cascade test/bench_cascade.c ${ WIN32_GETOPT } )
2013-12-09 18:05:32 +01:00
endif ( )
2016-11-07 00:46:45 +03:00
#
# Tests
#
macro ( add_test_prog prog )
add_executable ( ${ prog } test/ ${ prog } .c )
target_link_libraries ( ${ prog }
$ { L I B _ A P P S }
$ { L I B _ P L A T F O R M }
2018-11-22 23:00:11 +03:00
e v e n t _ c o r e
e v e n t _ e x t r a
2016-11-07 00:46:45 +03:00
$ { A R G N } )
endmacro ( )
2013-12-09 18:05:32 +01:00
if ( NOT EVENT__DISABLE_TESTS )
2013-12-12 16:33:20 +01:00
#
2013-12-12 18:21:11 +01:00
# Generate Regress tests.
2013-12-12 16:33:20 +01:00
#
2014-01-22 00:06:21 +01:00
if ( NOT EVENT__DISABLE_REGRESS )
2017-09-14 17:39:20 -05:00
# (We require python to generate the regress tests)
find_package ( PythonInterp 3 )
2015-12-20 00:43:46 -08:00
2017-09-14 17:39:20 -05:00
if ( PYTHONINTERP_FOUND )
2014-09-02 18:25:52 +04:00
set ( __FOUND_USABLE_PYTHON 1 )
2017-09-14 17:39:20 -05:00
else ( )
find_package ( PythonInterp 2 )
if ( PYTHONINTERP_FOUND )
set ( __FOUND_USABLE_PYTHON 1 )
else ( )
message ( ERROR "No suitable Python version found, bailing..." )
endif ( )
2014-09-02 18:25:52 +04:00
endif ( )
if ( __FOUND_USABLE_PYTHON )
2015-12-19 01:47:49 -08:00
message ( STATUS "Generating regress tests..." )
2015-12-20 00:43:46 -08:00
2014-01-22 00:06:21 +01:00
add_definitions ( -DTINYTEST_LOCAL )
2015-12-20 00:43:46 -08:00
2014-01-22 00:06:21 +01:00
add_custom_command (
2014-09-02 18:25:52 +04:00
O U T P U T
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t / r e g r e s s . g e n . c
2014-01-22 00:06:21 +01:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t / r e g r e s s . g e n . h
2014-09-02 18:25:52 +04:00
D E P E N D S
2014-01-22 00:06:21 +01:00
e v e n t _ r p c g e n . p y
2014-09-02 18:25:52 +04:00
t e s t / r e g r e s s . r p c
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } . . / e v e n t _ r p c g e n . p y r e g r e s s . r p c
2015-12-20 00:43:46 -08:00
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t )
2014-01-22 00:06:21 +01:00
2014-09-02 18:25:52 +04:00
list ( APPEND SRC_REGRESS
2016-11-07 00:46:45 +03:00
t e s t / r e g r e s s . c
t e s t / r e g r e s s . g e n . c
t e s t / r e g r e s s . g e n . h
t e s t / r e g r e s s _ b u f f e r . c
t e s t / r e g r e s s _ b u f f e r e v e n t . c
t e s t / r e g r e s s _ d n s . c
t e s t / r e g r e s s _ e t . c
t e s t / r e g r e s s _ f i n a l i z e . c
t e s t / r e g r e s s _ h t t p . c
t e s t / r e g r e s s _ l i s t e n e r . c
t e s t / r e g r e s s _ m a i n . c
t e s t / r e g r e s s _ m i n h e a p . c
t e s t / r e g r e s s _ r p c . c
t e s t / r e g r e s s _ t e s t u t i l s . c
t e s t / r e g r e s s _ t e s t u t i l s . h
t e s t / r e g r e s s _ u t i l . c
2019-03-26 13:33:57 -04:00
t e s t / r e g r e s s _ w a t c h . c
2016-11-07 00:46:45 +03:00
t e s t / t i n y t e s t . c )
2014-01-22 00:06:21 +01:00
if ( WIN32 )
list ( APPEND SRC_REGRESS test/regress_iocp.c )
2016-08-08 15:50:46 +03:00
if ( NOT EVENT__DISABLE_THREAD_SUPPORT )
list ( APPEND SRC_REGRESS test/regress_thread.c )
endif ( )
2016-11-07 00:46:45 +03:00
elseif ( CMAKE_USE_PTHREADS_INIT )
2014-01-22 00:06:21 +01:00
list ( APPEND SRC_REGRESS test/regress_thread.c )
endif ( )
2016-08-09 10:56:34 +03:00
if ( ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR )
2014-01-22 00:06:21 +01:00
list ( APPEND SRC_REGRESS test/regress_zlib.c )
endif ( )
2016-11-07 00:46:45 +03:00
if ( NOT EVENT__DISABLE_OPENSSL )
2014-01-22 00:06:21 +01:00
list ( APPEND SRC_REGRESS test/regress_ssl.c )
endif ( )
add_executable ( regress ${ SRC_REGRESS } )
2015-12-20 00:43:46 -08:00
target_link_libraries ( regress
2016-11-07 00:46:45 +03:00
$ { L I B _ A P P S }
$ { L I B _ P L A T F O R M }
2018-11-22 23:00:11 +03:00
e v e n t _ c o r e
e v e n t _ e x t r a )
2017-03-12 23:31:59 +03:00
if ( NOT EVENT__DISABLE_OPENSSL )
2018-11-22 23:00:11 +03:00
target_link_libraries ( regress event_openssl )
2017-03-12 23:31:59 +03:00
endif ( )
if ( CMAKE_USE_PTHREADS_INIT )
2018-11-22 23:00:11 +03:00
target_link_libraries ( regress event_pthreads )
2017-03-12 23:31:59 +03:00
endif ( )
2014-01-22 00:06:21 +01:00
else ( )
2014-09-02 18:25:52 +04:00
message ( WARNING "No suitable Python interpreter found, cannot generate regress tests!" )
2013-12-12 16:33:20 +01:00
endif ( )
2013-12-09 18:05:32 +01:00
endif ( )
2013-12-12 18:21:11 +01:00
#
# Test programs.
#
2016-11-07 00:46:45 +03:00
# all of these, including the cmakelists.txt should be moved
# into the dirctory 'tests' first.
#
# doing this, we can remove all the DISABLE_TESTS stuff, and simply
# do something like:
#
# add_custom_targets(tests)
# add_executable(... EXCLUDE_FROM_ALL ...c)
# add_dependencis(tests testa testb testc)
# add_test(....)
#
# then you can just run 'make tests' instead of them all
# auto-compile|running
# - ellzey
set ( TESTPROGS test-changelist
t e s t - e o f
t e s t - f d l e a k
t e s t - i n i t
t e s t - t i m e
t e s t - w e o f )
foreach ( TESTPROG ${ TESTPROGS } test-dumpevents )
add_test_prog ( ${ TESTPROG } )
endforeach ( )
if ( UNIX )
add_test_prog ( test-ratelim m )
else ( )
add_test_prog ( test-ratelim )
endif ( )
2013-12-12 18:21:11 +01:00
2015-12-20 00:43:46 -08:00
set ( ALL_TESTPROGS
2016-11-07 00:46:45 +03:00
$ { T E S T P R O G S }
t e s t - d u m p e v e n t s
t e s t - r a t e l i m
)
2013-12-12 18:21:11 +01:00
#
# We run all tests with the different backends turned on one at a time.
#
2013-12-16 16:37:51 +01:00
# Add event backends based on system introspection result.
set ( BACKENDS "" )
if ( EVENT__HAVE_EPOLL )
list ( APPEND BACKENDS EPOLL )
endif ( )
if ( EVENT__HAVE_SELECT )
list ( APPEND BACKENDS SELECT )
endif ( )
if ( EVENT__HAVE_POLL )
list ( APPEND BACKENDS POLL )
endif ( )
if ( EVENT__HAVE_KQUEUE )
list ( APPEND BACKENDS KQUEUE )
endif ( )
if ( EVENT__HAVE_EVENT_PORTS )
list ( APPEND BACKENDS EVPORT )
endif ( )
if ( EVENT__HAVE_DEVPOLL )
list ( APPEND BACKENDS DEVPOLL )
endif ( )
if ( WIN32 )
list ( APPEND BACKENDS WIN32 )
endif ( )
2013-12-12 18:21:11 +01:00
# Default environment variables turns off all event systems,
# then we enable each one, one at a time when creating the tests.
2013-12-16 16:37:51 +01:00
set ( DEFAULT_TEST_ENV_VARS "EVENT_SHOW_METHOD=1;" )
2013-12-12 18:21:11 +01:00
foreach ( BACKEND ${ BACKENDS } )
2013-12-16 16:44:13 +00:00
set ( BACKEND_ENV_VAR "EVENT_NO${BACKEND}=1" )
list ( APPEND DEFAULT_TEST_ENV_VARS "${BACKEND_ENV_VAR}" )
2013-12-12 18:21:11 +01:00
endforeach ( )
# Macro that creates the ctest test for a backend.
macro ( add_backend_test BACKEND_TEST_NAME ENV_VARS )
2013-12-16 16:37:51 +01:00
set ( TEST_NAMES "" )
2013-12-12 18:21:11 +01:00
foreach ( TESTPROG ${ TESTPROGS } )
2013-12-16 16:44:13 +00:00
set ( TEST_NAME ${ TESTPROG } __ ${ BACKEND_TEST_NAME } )
2015-12-20 00:43:46 -08:00
add_test ( ${ TEST_NAME }
2016-11-07 00:46:45 +03:00
$ { C M A K E _ R U N T I M E _ O U T P U T _ D I R E C T O R Y } / $ { T E S T P R O G } )
2015-12-20 00:43:46 -08:00
2013-12-16 16:37:51 +01:00
list ( APPEND TEST_NAMES ${ TEST_NAME } )
2015-12-20 00:43:46 -08:00
set_tests_properties ( ${ TEST_NAME }
2016-11-07 00:46:45 +03:00
P R O P E R T I E S E N V I R O N M E N T " $ { E N V _ V A R S } " )
2013-12-12 18:21:11 +01:00
endforeach ( )
# Dump events test.
2014-09-02 18:25:52 +04:00
if ( __FOUND_USABLE_PYTHON )
2013-12-16 16:44:13 +00:00
set ( TEST_NAME test-dumpevents__ ${ BACKEND_TEST_NAME } )
2015-12-20 00:43:46 -08:00
add_test ( ${ TEST_NAME }
2016-11-07 00:46:45 +03:00
$ { C M A K E _ R U N T I M E _ O U T P U T _ D I R E C T O R Y } / t e s t - d u m p e v e n t s |
$ { P Y T H O N _ E X E C U T A B L E }
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t / c h e c k - d u m p e v e n t s . p y )
2015-12-20 00:43:46 -08:00
set_tests_properties ( ${ TEST_NAME }
2016-11-07 00:46:45 +03:00
P R O P E R T I E S E N V I R O N M E N T " $ { E N V _ V A R S } " )
2013-12-12 18:21:11 +01:00
else ( )
message ( WARNING "test-dumpevents will be run without output check since python was not found!" )
2013-12-16 16:44:13 +00:00
set ( TEST_NAME test-dumpevents__ ${ BACKEND_TEST_NAME } _no_check )
2015-12-20 00:43:46 -08:00
add_test ( ${ TEST_NAME }
2016-11-07 00:46:45 +03:00
$ { C M A K E _ R U N T I M E _ O U T P U T _ D I R E C T O R Y } / t e s t - d u m p e v e n t s )
2015-12-20 00:43:46 -08:00
set_tests_properties ( ${ TEST_NAME }
2016-11-07 00:46:45 +03:00
P R O P E R T I E S E N V I R O N M E N T " $ { E N V _ V A R S } " )
2013-12-12 18:21:11 +01:00
endif ( )
# Regress tests.
2014-09-02 18:25:52 +04:00
if ( NOT EVENT__DISABLE_REGRESS AND __FOUND_USABLE_PYTHON )
2013-12-16 16:44:13 +00:00
set ( TEST_NAME regress__ ${ BACKEND_TEST_NAME } )
2015-09-02 11:51:00 +03:00
2015-12-20 00:43:46 -08:00
add_test ( ${ TEST_NAME }
2016-11-07 00:46:45 +03:00
$ { C M A K E _ R U N T I M E _ O U T P U T _ D I R E C T O R Y } / r e g r e s s )
2015-12-20 00:43:46 -08:00
set_tests_properties ( ${ TEST_NAME }
2016-11-07 00:46:45 +03:00
P R O P E R T I E S E N V I R O N M E N T " $ { E N V _ V A R S } " )
2015-12-20 00:43:46 -08:00
add_test ( ${ TEST_NAME } _debug
2016-11-07 00:46:45 +03:00
$ { C M A K E _ R U N T I M E _ O U T P U T _ D I R E C T O R Y } / r e g r e s s )
2015-12-20 00:43:46 -08:00
set_tests_properties ( ${ TEST_NAME } _debug
2016-11-07 00:46:45 +03:00
P R O P E R T I E S E N V I R O N M E N T " $ { E N V _ V A R S } ; E V E N T _ D E B U G _ M O D E = 1 " )
2013-12-12 18:21:11 +01:00
endif ( )
endmacro ( )
# Add the tests for each backend.
foreach ( BACKEND ${ BACKENDS } )
# Enable this backend only.
set ( BACKEND_ENV_VARS ${ DEFAULT_TEST_ENV_VARS } )
2013-12-13 17:00:23 +01:00
list ( REMOVE_ITEM BACKEND_ENV_VARS EVENT_NO ${ BACKEND } =1 )
2013-12-12 18:21:11 +01:00
# Epoll has some extra settings.
if ( ${ BACKEND } STREQUAL "EPOLL" )
2015-12-20 00:43:46 -08:00
add_backend_test ( timerfd_ ${ BACKEND }
" $ { B A C K E N D _ E N V _ V A R S } ; E V E N T _ P R E C I S E _ T I M E R = 1 " )
add_backend_test ( changelist_ ${ BACKEND }
" $ { B A C K E N D _ E N V _ V A R S } ; E V E N T _ E P O L L _ U S E _ C H A N G E L I S T = y e s " )
add_backend_test ( timerfd_changelist_ ${ BACKEND }
" $ { B A C K E N D _ E N V _ V A R S } ; E V E N T _ E P O L L _ U S E _ C H A N G E L I S T = y e s ; E V E N T _ P R E C I S E _ T I M E R = 1 " )
2013-12-12 18:21:11 +01:00
else ( )
2013-12-16 16:37:51 +01:00
add_backend_test ( ${ BACKEND } "${BACKEND_ENV_VARS}" )
2013-12-12 18:21:11 +01:00
endif ( )
endforeach ( )
#
# Rate limiter tests.
#
# Group limits, no connection limit.
2016-11-07 00:46:45 +03:00
set ( RL_BIN ${ CMAKE_RUNTIME_OUTPUT_DIRECTORY } /test-ratelim )
2015-12-20 00:43:46 -08:00
add_test ( test-ratelim__group_lim
2016-11-07 00:46:45 +03:00
$ { R L _ B I N }
- g 3 0 0 0 0
- n 3 0
- t 1 0 0
- - c h e c k - g r o u p l i m i t 1 0 0 0
- - c h e c k - s t d d e v 1 0 0 )
2013-12-12 18:21:11 +01:00
# Connection limit, no group limit.
2015-12-20 00:43:46 -08:00
add_test ( test-ratelim__con_lim
2016-11-07 00:46:45 +03:00
$ { R L _ B I N }
- c 1 0 0 0
- n 3 0
- t 1 0 0
- - c h e c k - c o n n l i m i t 5 0
- - c h e c k - s t d d e v 5 0 )
2014-09-02 18:25:52 +04:00
2013-12-12 18:21:11 +01:00
# Connection limit and group limit.
2015-12-20 00:43:46 -08:00
add_test ( test-ratelim__group_con_lim
2016-11-07 00:46:45 +03:00
$ { R L _ B I N }
- c 1 0 0 0
- g 3 0 0 0 0
- n 3 0
- t 1 0 0
- - c h e c k - g r o u p l i m i t 1 0 0 0
- - c h e c k - c o n n l i m i t 5 0
- - c h e c k - s t d d e v 5 0 )
2014-09-02 18:25:52 +04:00
2013-12-12 18:21:11 +01:00
# Connection limit and group limit with independent drain.
2015-12-20 00:43:46 -08:00
add_test ( test-ratelim__group_con_lim_drain
2016-11-07 00:46:45 +03:00
$ { R L _ B I N }
- c 1 0 0 0
- g 3 5 0 0 0
- n 3 0
- t 1 0 0
- G 5 0 0
- - c h e c k - g r o u p l i m i t 1 0 0 0
- - c h e c k - c o n n l i m i t 5 0
- - c h e c k - s t d d e v 5 0 )
2013-12-12 18:21:11 +01:00
2013-12-16 16:44:13 +00:00
# Add a "make verify" target, same as for autoconf.
2014-09-02 18:25:52 +04:00
# (Important! This will unset all EVENT_NO* environment variables.
2013-12-16 16:44:13 +00:00
# If they are set in the shell the tests are running using simply "ctest" or "make test" will fail)
2013-12-16 18:10:32 +01:00
if ( WIN32 )
2014-01-22 12:12:51 +01:00
# 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
"
s e t E V E N T _ N O W I N 3 2 =
\ " $ { W I N D O W S _ C T E S T _ C O M M A N D } \ "
" )
2015-12-19 01:47:49 -08:00
message ( STATUS "${WINDOWS_CTEST_COMMAND}" )
2014-01-22 12:12:51 +01:00
2015-12-20 00:43:46 -08:00
file ( COPY ${ CMAKE_CURRENT_BINARY_DIR } /tmp/verify_tests.bat
2016-11-07 00:46:45 +03:00
D E S T I N A T I O N $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R }
F I L E _ P E R M I S S I O N S
O W N E R _ R E A D
O W N E R _ W R I T E
O W N E R _ E X E C U T E
G R O U P _ R E A D
G R O U P _ E X E C U T E
W O R L D _ R E A D W O R L D _ E X E C U T E )
2015-12-20 00:43:46 -08:00
file ( TO_NATIVE_PATH
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / v e r i f y _ t e s t s . b a t " V E R I F Y _ P A T H )
2014-01-22 12:12:51 +01:00
add_custom_target ( verify COMMAND "${VERIFY_PATH}"
2016-11-07 00:46:45 +03:00
D E P E N D S e v e n t $ { A L L _ T E S T P R O G S } )
2013-12-16 18:10:32 +01:00
else ( )
2013-12-19 10:54:52 +01:00
# On some platforms doing exec(unset) as CMake does won'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
"
#!/bin/bash
u n s e t E V E N T _ N O E P O L L ; u n s e t E V E N T _ N O P O L L ; u n s e t E V E N T _ N O S E L E C T ; u n s e t E V E N T _ N O W I N 3 2 ; u n s e t E V E N T _ N O E V P O R T ; u n s e t E V E N T _ N O K Q U E U E ; u n s e t E V E N T _ N O D E V P O L L
$ { C M A K E _ C T E S T _ C O M M A N D }
" )
# Then we copy the file (this allows us to set execute permission on it)
file ( COPY ${ CMAKE_CURRENT_BINARY_DIR } /tmp/verify_tests.sh
2016-11-07 00:46:45 +03:00
D E S T I N A T I O N $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R }
F I L E _ P E R M I S S I O N S
O W N E R _ R E A D
O W N E R _ W R I T E
O W N E R _ E X E C U T E
G R O U P _ R E A D
G R O U P _ E X E C U T E
W O R L D _ R E A D
W O R L D _ E X E C U T E )
2013-12-19 10:54:52 +01:00
# Create the target that runs the script.
2015-12-20 00:43:46 -08:00
add_custom_target ( verify
2016-11-07 00:46:45 +03:00
C O M M A N D $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / v e r i f y _ t e s t s . s h
D E P E N D S e v e n t $ { A L L _ T E S T P R O G S } )
2013-12-16 18:10:32 +01:00
endif ( )
2013-12-16 16:44:13 +00:00
2014-09-02 18:25:52 +04:00
if ( NOT EVENT__DISABLE_REGRESS AND __FOUND_USABLE_PYTHON )
2013-12-16 16:44:13 +00:00
add_dependencies ( verify regress )
endif ( )
2013-12-17 15:17:29 +00:00
if ( EVENT__COVERAGE )
include ( CodeCoverage )
setup_target_for_coverage (
v e r i f y _ c o v e r a g e # Coverage target name "make verify_coverage"
m a k e # Test runner.
c o v e r a g e # Output directory.
v e r i f y ) # Arguments passed to test runner. "make verify"
endif ( )
2013-12-09 18:05:32 +01:00
enable_testing ( )
include ( CTest )
endif ( )
2014-01-09 13:44:38 +01:00
#
# Installation preparation.
#
if ( WIN32 AND NOT CYGWIN )
set ( DEF_INSTALL_CMAKE_DIR cmake )
else ( )
set ( DEF_INSTALL_CMAKE_DIR lib/cmake/libevent )
endif ( )
2017-03-13 03:18:02 +03:00
set ( EVENT_INSTALL_CMAKE_DIR
" $ { C M A K E _ I N S T A L L _ P R E F I X } / $ { D E F _ I N S T A L L _ C M A K E _ D I R } "
C A C H E P A T H " I n s t a l l a t i o n d i r e c t o r y f o r C M a k e f i l e s " )
2014-01-09 13:44:38 +01:00
export ( PACKAGE libevent )
# Generate the config file for the build-tree.
2014-09-02 18:25:52 +04:00
set ( EVENT__INCLUDE_DIRS
2014-01-09 13:44:38 +01:00
" $ { P R O J E C T _ S O U R C E _ D I R } / i n c l u d e "
" $ { P R O J E C T _ B I N A R Y _ D I R } / i n c l u d e " )
2015-12-20 00:43:46 -08:00
set ( LIBEVENT_INCLUDE_DIRS
$ { E V E N T _ _ I N C L U D E _ D I R S }
C A C H E P A T H " L i b e v e n t i n c l u d e d i r e c t o r i e s " )
2015-02-05 00:56:58 +01:00
configure_file ( ${ PROJECT_SOURCE_DIR } /cmake/LibeventConfigBuildTree.cmake.in
2017-03-13 03:18:02 +03:00
$ { P R O J E C T _ B I N A R Y _ D I R } / L i b e v e n t C o n f i g . c m a k e
@ O N L Y )
2014-01-09 13:44:38 +01:00
# Generate the config file for the installation tree.
2017-03-13 03:18:02 +03:00
# Calculate the relative directory from the Cmake dir.
2014-09-02 18:25:52 +04:00
file ( RELATIVE_PATH
2017-03-13 03:18:02 +03:00
R E L _ I N C L U D E _ D I R
" $ { E V E N T _ I N S T A L L _ C M A K E _ D I R } "
" $ { C M A K E _ I N S T A L L _ P R E F I X } / i n c l u d e " )
2014-01-09 13:44:38 +01:00
2017-11-29 11:13:51 +03:00
# Note the LIBEVENT_CMAKE_DIR is defined in LibeventConfig.cmake.in,
2014-01-09 13:44:38 +01:00
# we escape it here so it's evaluated when it is included instead
2017-11-29 11:13:51 +03:00
# so that the include dirs are given relative to where the
2014-01-09 13:44:38 +01:00
# config file is located.
2017-11-29 11:13:51 +03:00
set ( EVENT_INSTALL_INCLUDE_DIR "\${LIBEVENT_CMAKE_DIR}/${REL_INCLUDE_DIR}" )
2015-12-20 00:43:46 -08:00
2014-01-09 13:44:38 +01:00
configure_file ( ${ PROJECT_SOURCE_DIR } /cmake/LibeventConfig.cmake.in
2017-03-13 03:18:02 +03:00
$ { P R O J E C T _ B I N A R Y _ D I R } $ { C M A K E _ F I L E S _ D I R E C T O R Y } / L i b e v e n t C o n f i g . c m a k e
@ O N L Y )
2014-01-09 13:44:38 +01:00
# Generate version info for both build-tree and install-tree.
configure_file ( ${ PROJECT_SOURCE_DIR } /cmake/LibeventConfigVersion.cmake.in
2017-03-13 03:18:02 +03:00
$ { P R O J E C T _ B I N A R Y _ D I R } / L i b e v e n t C o n f i g V e r s i o n . c m a k e
@ O N L Y )
2014-01-09 13:44:38 +01:00
2014-09-02 18:25:52 +04:00
# Install compat headers
install ( FILES ${ HDR_COMPAT }
2017-03-13 03:18:02 +03:00
D E S T I N A T I O N " i n c l u d e "
2016-11-07 00:46:45 +03:00
C O M P O N E N T d e v )
2014-01-09 13:44:38 +01:00
# Install the configs.
install ( FILES
2016-11-07 00:46:45 +03:00
$ { P R O J E C T _ B I N A R Y _ D I R } / $ { C M A K E _ F I L E S _ D I R E C T O R Y } / L i b e v e n t C o n f i g . c m a k e
$ { P R O J E C T _ B I N A R Y _ D I R } / L i b e v e n t C o n f i g V e r s i o n . c m a k e
D E S T I N A T I O N " $ { E V E N T _ I N S T A L L _ C M A K E _ D I R } "
2015-12-20 00:43:46 -08:00
C O M P O N E N T d e v )
2014-01-09 13:44:38 +01:00
# Install exports for the install-tree.
2014-02-19 06:29:58 +01:00
install ( EXPORT LibeventTargets
2017-03-13 03:18:02 +03:00
D E S T I N A T I O N " $ { D E F _ I N S T A L L _ C M A K E _ D I R } "
2016-11-07 00:46:45 +03:00
C O M P O N E N T d e v )
2015-12-19 01:47:49 -08:00
2019-06-09 20:15:37 +08:00
# Install the scripts.
install ( PROGRAMS
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / e v e n t _ r p c g e n . p y
D E S T I N A T I O N " b i n "
C O M P O N E N T r u n t i m e )
# Create documents with doxygen.
2019-08-23 21:48:05 +08:00
option ( EVENT__DOXYGEN
" E n a b l e s d o x y g e n d o c u m e n t a t i o n " O F F )
if ( EVENT__DOXYGEN )
include ( UseDoxygen )
UseDoxygen ( )
2019-06-09 20:15:37 +08:00
endif ( )
# Create the uninstall target.
# https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake
configure_file ( ${ PROJECT_SOURCE_DIR } /cmake/Uninstall.cmake.in
$ { P R O J E C T _ B I N A R Y _ D I R } / U n i n s t a l l . c m a k e
@ O N L Y )
add_custom_target ( uninstall
C O M M A N D $ { C M A K E _ C O M M A N D } - P $ { P R O J E C T _ B I N A R Y _ D I R } / U n i n s t a l l . c m a k e )
2016-08-07 23:07:44 +03:00
message ( STATUS "" )
message ( STATUS " ---( Libevent " ${ EVENT_VERSION } " )---" )
message ( STATUS "" )
2015-12-19 01:47:49 -08:00
message ( STATUS "Available event backends: ${BACKENDS}" )
2018-10-27 14:58:30 +03:00
message ( STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}" )
message ( STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}" )
message ( STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}" )
message ( STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}" )
message ( STATUS "PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}" )
message ( STATUS "PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}" )
message ( STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}" )
message ( STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}" )
message ( STATUS "CMAKE_ROOT: ${CMAKE_ROOT}" )
message ( STATUS "CMAKE_SYSTEM: ${CMAKE_SYSTEM}" )
message ( STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}" )
message ( STATUS "CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}" )
message ( STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}" )
message ( STATUS "CMAKE_SKIP_RPATH: ${CMAKE_SKIP_RPATH}" )
message ( STATUS "CMAKE_VERBOSE_MAKEFILE: ${CMAKE_VERBOSE_MAKEFILE}" )
message ( STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}" )
message ( STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}" )
message ( STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER} (id ${CMAKE_C_COMPILER_ID}, clang ${CLANG}, GNUC ${GNUC})" )
message ( STATUS "CMAKE_AR: ${CMAKE_AR}" )
message ( STATUS "CMAKE_RANLIB: ${CMAKE_RANLIB}" )
2016-08-07 23:07:44 +03:00
message ( STATUS "" )
2015-12-20 00:43:46 -08:00