]> granicus.if.org Git - libevent/commit
cmake: replace CheckFunctionExists with CheckSymbolExists
authoryuangongji <yuangongji@foxmail.com>
Fri, 20 Mar 2020 09:49:37 +0000 (17:49 +0800)
committeryuangongji <yuangongji@foxmail.com>
Sun, 22 Mar 2020 14:22:51 +0000 (22:22 +0800)
commit41d1d75a84e03219ec037b0f7982a67fb031eae7
treeb7d5b840d3e56fb55e34aaae19cd4b5c46639f7b
parent1675a55620e6f0bbba5776f2df72cd48920421c2
cmake: replace CheckFunctionExists with CheckSymbolExists

Checking functions with `CheckFunctionExists` may
get wrong results, we should replace it with
`CheckSymbolExists`, which is recommended by the cmake
official documentation.
Before using `CheckSymbolExists`, we use
`CheckIncludeFiles` to check header files and save the
available header files in a variable that guarantees
`CheckSymbolExists` and `CheckTypeSize` to work correctly.
This approach is modeled after the cmake scripts of `curl`.

The following functions or files were not found before
modification, they can now be found:
- msys2 + mingw-8.1.0 on Windows10 or mingw-7.3.0 on Ubuntu-18.04
timerclear
timercmp
timerisset

- windows10
getaddrinfo
getnameinfo
getprotobynumber
getservbyname
putenv
strtoll
timerclear
timercmp
timerisset

- ubuntu-18.04
sys/sysctl.h
timeradd
timerclear
timercmp
timerisset

- MacOS 10.13
sys/random.h
timeradd
timerclear
timercmp
timerisset
CMakeLists.txt
cmake/CheckSymbolsExist.cmake [deleted file]
cmake/Macros.cmake [new file with mode: 0644]
event-config.h.cmake