]> granicus.if.org Git - libevent/commitdiff
cmake: detect _GNU_SOURCE not by __GNU_LIBRARY__ only (fallback to _GNU_SOURCE)
authorAzat Khuzhin <a3at.mail@gmail.com>
Sun, 5 Mar 2017 21:30:21 +0000 (00:30 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Wed, 8 Mar 2017 10:31:55 +0000 (13:31 +0300)
Fixes pipe2() on Android-9/armv7-a

Refs: #475

CMakeLists.txt

index 1eabc2433fe9ccaf5403c285290390922e5a04e5..a861e7d96340c19e0dcca05eceb0ac4bcec9bded 100644 (file)
@@ -224,7 +224,14 @@ if (SOLARIS)
 endif()
 
 # 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)
     add_definitions(-D_GNU_SOURCE)