Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[cmake] Add _DARWIN_C_SOURCE
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 16 Jun 2015 09:45:28 +0000 (11:45 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 16 Jun 2015 09:46:02 +0000 (11:46 +0200)
It is needed when defining a specific value of _XOPEN_SOURCE.

buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/Flags.cmake

index 3802ed9..f9d702c 100644 (file)
@@ -131,7 +131,7 @@ CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB
 CHECK_LIBRARY_EXISTS(rt      clock_gettime           "" HAVE_POSIX_GETTIME)
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
 CHECK_LIBRARY_EXISTS(rt      clock_gettime           "" HAVE_POSIX_GETTIME)
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700")
+  set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_")
 endif()
 
 CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME)
 endif()
 
 CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME)
@@ -439,7 +439,7 @@ endif()
 
 # This is needed for ucontext on MacOS X:
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
 
 # This is needed for ucontext on MacOS X:
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  add_definitions(-D_XOPEN_SOURCE=700)
+  add_definitions(-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE)
 endif()
 
 if(WIN32)
 endif()
 
 if(WIN32)
index 1ad0941..3fe0a43 100644 (file)
@@ -126,7 +126,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${optCFLAGS}")
 
 # Try to make Mac a bit more complient to open source standards
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
 
 # Try to make Mac a bit more complient to open source standards
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE")
 endif()
 
 set(TESH_OPTION "")
 endif()
 
 set(TESH_OPTION "")