Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove the need of pthread_mutex in mmalloc, to allow its use with sthread
[simgrid.git] / CMakeLists.txt
index d39d92a..048ddd6 100644 (file)
@@ -412,6 +412,8 @@ if(enable_model-checking)
     message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling the Java bindings.")
     set(enable_java FALSE)
   endif()
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-4")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-4")
 else()
   SET(SIMGRID_HAVE_MC 0)
   set(HAVE_MMALLOC 0)
@@ -454,27 +456,27 @@ else()
     OUTPUT_VARIABLE compile_makecontext_output)
 
   #If can have both context
-  if(compile_makecontext)
-    set(HAVE_UCONTEXT_CONTEXTS 1)
-    message(STATUS "Support for ucontext factory ok.")
-  else()
+  if(NOT compile_makecontext)
     message(STATUS "Error: <ucontext.h> exists, but makecontext is not compilable. Compilation output:\n ${compile_makecontext_output}")
     message(STATUS "No ucontext factory: makecontext() is not compilable.")
-  endif()
-
-  # Stack setup (size and address)
-  try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
-    ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stacksetup.c
-    RUN_OUTPUT_VARIABLE stack_setup)
-
-  LIST(LENGTH stack_setup stack_setup_len)
-  if("${stack_setup_len}" STREQUAL "2")
-    LIST(GET stack_setup 0 makecontext_addr)
-    LIST(GET stack_setup 1 makecontext_size)
-    set(sg_makecontext_stack_addr "#define sg_makecontext_stack_addr(skaddr) (${makecontext_addr})")
-    set(sg_makecontext_stack_size "#define sg_makecontext_stack_size(sksize) (${makecontext_size})")
   else()
-    message(FATAL_ERROR "Could not figure out the stack setup. Compil: ${RUN_makecontext_VAR}. Exec: ${COMPILE_makecontext_VAR}. Output: ${stack_setup}")
+    message(STATUS "Support for ucontext factory ok.")
+    set(HAVE_UCONTEXT_CONTEXTS 1)
+
+    # Stack setup (size and address)
+    try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
+      ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stacksetup.c
+      RUN_OUTPUT_VARIABLE stack_setup)
+
+    LIST(LENGTH stack_setup stack_setup_len)
+    if("${stack_setup_len}" STREQUAL "2")
+      LIST(GET stack_setup 0 makecontext_addr)
+      LIST(GET stack_setup 1 makecontext_size)
+      set(sg_makecontext_stack_addr "#define sg_makecontext_stack_addr(skaddr) (${makecontext_addr})")
+      set(sg_makecontext_stack_size "#define sg_makecontext_stack_size(sksize) (${makecontext_size})")
+    else()
+      message(FATAL_ERROR "Could not figure out the stack setup. Compil: ${RUN_makecontext_VAR}. Exec: ${COMPILE_makecontext_VAR}. Output: ${stack_setup}")
+    endif()
   endif()
 endif()