Browse Source

CMake: Define _GNU_SOURCE only for glibc

pull/108/head
Daniel Scharrer 7 years ago
parent
commit
23072f62a2
  1. 3
      CMakeLists.txt

3
CMakeLists.txt

@ -221,7 +221,8 @@ endif()
# Older glibc versions won't provide some useful symbols by default - request them
# This flag is currently also set by gcc when compiling C++, but not for plain C
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
check_symbol_exists(__GLIBC__ "features.h" HAVE_GLIBC)
if(HAVE_GLIBC)
set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE=1")
add_definitions(-D_GNU_SOURCE=1)
endif()

Loading…
Cancel
Save