I test accept4 on Linux as follows:
check_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4)
However, accept4 is only defined if _GNU_SOURCE is predefined. How can I get the checker to determine _GNU_SOURCE before checking?
Of course, use list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) before calling check_symbol_exists() and list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) to clear after checking.
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
check_symbol_exists()
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
Source: https://habr.com/ru/post/1440460/More articles:JNA mapping for uint8_t and int8_t - javaSave and access data through a web service on a remote server in android - androidInstalling only the client hero, and not other things - ruby | fooobar.comSubscribe to XMPP - androidCkeditor property to resize image - jqueryDynamic usage tracking on Heroku - herokuDynamically updated maps with Achartengine - androidExit to add a friend to xmpp smack - androidChanging arbitrary image size in PHP - phpHow to set browser size using QtWebKit - pythonAll Articles