mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
cmake: detect _GNU_SOURCE not by __GNU_LIBRARY__ only (fallback to _GNU_SOURCE)
Fixes pipe2() on Android-9/armv7-a Refs: #475
This commit is contained in:
parent
66a4eb0c3a
commit
71a56bd3a7
@ -224,7 +224,14 @@ if (SOLARIS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Check if _GNU_SOURCE is available.
|
# Check if _GNU_SOURCE is available.
|
||||||
CHECK_SYMBOL_EXISTS(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)
|
if (NOT _GNU_SOURCE)
|
||||||
|
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()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (_GNU_SOURCE)
|
if (_GNU_SOURCE)
|
||||||
add_definitions(-D_GNU_SOURCE)
|
add_definitions(-D_GNU_SOURCE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user