'LIBEVENT_INCLUDE_DIRS' is properly initialized in 'LibeventConfig.cmake' as
'LibeventConfig.cmake.in' contains usage of 'LIBEVENT_CMAKE_DIR' and
'EVENT_INSTALL_INCLUDE_DIR' variables but not 'EVENT_CMAKE_DIR' and
'EVENT__INCLUDE_DIRS'.
Related typos are fixed.
==> win: CMake Warning (dev) at CMakeLists.txt:782 (elseif):
==> win: Policy CMP0054 is not set: Only interpret if() arguments as variables or
==> win: keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
==> win: details. Use the cmake_policy command to set the policy and suppress this
==> win: warning.
==> win:
==> win: Quoted variables like "MSVC" will no longer be dereferenced when the policy
==> win: is set to NEW. Since the policy is not set the OLD behavior will be used.
==> win: This warning is for project developers. Use -Wno-dev to suppress it.
Defaults apple linker behaviour is -two_levelnamespace, and you cannot
use "-undefined suppress" with it, so let's link non event_core with
event_core library to avoid undefined symbols.
Remove next vars, since I don't think that somebody want to change it:
- bin
- lib
- include
And fix exports problem:
CMake Error: INSTALL(EXPORT "LibeventTargets") given absolute DESTINATION "/usr/lib/cmake/libevent" but the export references an installation of target "event_core_static" which has relative DESTINATION "lib".
Since they are useful for debugging, and if autotools build them then
cmamke has to do this too, to make migration more simple.
And now:
- tests: uses shared libraries (since this is upstreams one)
- other binaries: uses static libraries
This removes next private config:
- EVENT__NEED_DLLIMPORT
This will remove openssl requirement if you don't use it (i.e. if you
not link with openssl_pthreads).
Plus it fixes some linking dependencies:
- libm required only for test-ratelim
And fix some coding style alignment issues.
Refs: #246
Nowadays mostly all supported OS'es has this wrappers, and some of them (like
SmartOS) has wrappers but doesn't have __NR_epoll* defines for syscall numbers,
so just drop them (instead of adding yet another check int cmake like autotools
has, since this will break building in cross-compile environment).
Also one minor note, configure doesn't added epoll_sub.c either, since it check
epoll_create() in runtime.
And I tested it in SmartOS and it even works (`make verify`).
Fixes: #463
Because checking in cmake breaks cross-compiling.
Introduced-in: 43eb56c7c738e3642f0981e3dd6ab9e082eec798.
Fixes: #482Fixes: #462
Refs: #475
v2: use waitid() with WNOWAIT
v3: use WNOWAIT only if it available in waitpid(), because not all netbsd
supports it
CheckSymbolExists do not do this, so add new CheckConstExists that will
use CheckCSourceCompiles() to check this.
v2: use set() instead of string(APPEND)
This reverts commit c4e9d9bd662de7f575f2172c160795d452ebe709
("sample/https-client: check for ERR_remove_thread_state() existence").
Calling AC_SEARCH_LIBS() modifies LIBS - -lcrypto incorrectly
ends up in LIBS, and thus linked to by libevent_core.so.
Checking for ERR_remove_thread_state should no longer be needed
because it was introduced in openssl 1.0.0, and the previous line
0.9.8 had support discontinued at the end of 2015.
Fixes: #473
By setting the CMake minimum version to 3.1 CMake automatically
adds the correct magic to make the library relocatable on
the filesystem (instead of burning the location of the library
at link time into the binary).
ex:
otool -L bin/http-connect
bin/http-connect:
@rpath/libevent_extra.2.2.0.dylib (compatibility version 2.2.0, current version 0.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
Fixes: #468 (cherry-picked)
It did not work before correctly anyway, since cmake do not reset cache
entries by default, so that reset to "beta" didn't work.
But I don't think that making this variable cached is useful, so let's
remove this.
And according to f8d80a285cf941505277d9060d0357b5b7e543d2 ("Bump version
to 2.1.3-alpha-dev") numeric version have 1 at the end, since it means
"-dev".
P.S. in referenced commit I made a mistake and instead of *-rc* I wrote
*-beta*.
See-also: f4489b8323cda0bf8eed7c1353911a852d7a947c ("Bump version to
2.1.7-beta everywhere")
- do not use compiler check from the root cmake rules with syntax error,
let CodeCoverage check it
- fix CodeCoverage to check C compiler not CXX
- case insensitive checking of CMAKE_BUILD_TYPE
- replace flags with --coverage, and fix flags with linking with
--coverate, otherwise it will not compile during checking flags and
fails.
python version check removed in a4d044c0cd97f68b4b3dde414b83d609719d33d7
("cmake: use PYTHON_EXECUTABLE to find python2"), but in
bcb990ab7cf4921c2c30a1aa4fcb4c0131fffe94 ("cmake/win32: fix running
regress, but fixing finding python2 interpreter") we set
PYTHON_EXECUTABLE only if it exists.
- Remove a redundant check on netdb.h (EVENT__HAVE_NETDB_H).
- Properly setup EVENT__SIZEOF_SSIZE_T for the case where "ssize_t" is
not "int".
- Remove unused EVENT__HAVE_PTHREAD.
- Set EVENT__HAVE_LIBZ instead of EVENT__HAVE_ZLIB (and remove the
latter).
Closes: #391 (cherry-picked from PR)
According to solaris docs:
"One instance of a SIGCHLD signal is queued for each child process whose
status has changed. If waitpid() returns because the status of a child
process is available, and WNOWAIT was not specified in options, any pending
SIGCHLD signal associated with the process ID of that child process is
discarded. Any other pending SIGCHLD signals remain pending."
And interesting thing that it works if you add sleep(1) before waitpid(), and
also if you run with --verbose (some race or what).
But linux doesn't support WNOWAIT in waitpid() so add detection into
cmake/autotools.
Fixes: #387
Link: https://bugzilla.redhat.com/show_bug.cgi?id=840782
Otherwise we will not detect next functions for instance:
- gethostbyname_r # and related
And now both autotools/cmake builds passes all regress tests in basic env (on
solaris of course).
Fixes: dns/client_fail_requests_getaddrinfo
- add_compiler_flags() must accept array IOW just ARGN will be enoough
- add_compiler_flags() called with variable name instead of it's value
P.S. and fix some alignments issues
P.P.S. more cmake issues expected since now CFLAGS actually works
P.P.P.S. some issues with cmake cache is possible, so just reset it
According to https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html:
-Wswitch-enum
Warn whenever a switch statement has an index of enumerated type and lacks a
case for one or more of the named codes of that enumeration. case labels
outside the enumeration range also provoke warnings when this option is used.
The only difference between -Wswitch and this option is that this option
gives a warning about an omitted enumeration code even if there is a *default
label*.