aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-11-05 22:49:16 -0800
committerChris Robinson <[email protected]>2013-11-05 22:49:16 -0800
commitb84f6d100f3583aef19bb5c61e5d6f6fb1317e2a (patch)
tree1ec5ec3d547b66cb8473849e79751fe4cb03e31c /CMakeLists.txt
parent801b7cb059baf568050c40ac14eb65f8863837b3 (diff)
Set -D_GNU_SOURCE=1 earlier
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 755e0944..9e5169e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -387,6 +387,10 @@ ENDIF()
# Check if we have Windows headers
CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H -D_WIN32_WINNT=0x0501)
IF(NOT HAVE_WINDOWS_H)
+ # _GNU_SOURCE is needed on some systems for extra features
+ ADD_DEFINITIONS(-D_GNU_SOURCE=1)
+ SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE=1")
+
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
IF(NOT HAVE_GETTIMEOFDAY)
MESSAGE(FATAL_ERROR "No timing function found!")
@@ -412,10 +416,6 @@ IF(NOT HAVE_WINDOWS_H)
SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
ENDIF()
- # _GNU_SOURCE is needed on some systems for extra attributes
- ADD_DEFINITIONS(-D_GNU_SOURCE=1)
- SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE=1")
-
CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD)
IF(HAVE_LIBPTHREAD)
SET(EXTRA_LIBS pthread ${EXTRA_LIBS})