Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
To use ucontext on OSX gcc must be greater than 4.5
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index 492c173..49d1d00 100644 (file)
@@ -697,6 +697,16 @@ if(ADDR2LINE)
 set(ADDR2LINE "${ADDR2LINE}/addr2line")
 endif(ADDR2LINE)
 
+
+
+### Check if OSX can compile with ucontext (with gcc 4.[1-5] it is broken)
+if(APPLE)
+    if(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR)
+        message(STATUS "Ucontext can't be used with this version of gcc (must be greater than 4.5")
+        set(HAVE_UCONTEXT_H 0)
+    endif(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR)
+endif(APPLE)
+
 ### File to create
 
 configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in"                  "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE)