set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
endif()
-CHECK_INCLUDE_FILE("valgrind/valgrind.h" HAVE_VALGRIND_VALGRIND_H)
+CHECK_INCLUDE_FILE("valgrind/valgrind.h" HAVE_VALGRIND_H)
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H)
execute_process(
COMMAND "${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_thread_storage.c"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- RESULT_VARIABLE HAVE_thread_storage_run
- )
+ RESULT_VARIABLE HAVE_thread_storage_run)
+
if(HAVE_thread_storage_run)
set(HAVE_THREAD_LOCAL_STORAGE 1)
endif()
if(enable_mallocators)
- SET(MALLOCATOR_IS_WANTED 1)
+ SET(HAVE_MALLOCATOR 1)
else()
- SET(MALLOCATOR_IS_WANTED 0)
+ SET(HAVE_MALLOCATOR 0)
endif()
if(enable_model-checking AND HAVE_MMALLOC)
SET(HAVE_MC 1)
- SET(MMALLOC_WANT_OVERRIDE_LEGACY 1)
include(FindLibunwind)
include(FindLibdw)
else()
if(enable_model-checking)
- message(STATUS "Warning: support for model-checking has been disabled because HAVE_MMALLOC is false")
+ message(STATUS "Warning: support for model-checking has been disabled because you are missing either mmap or __thread.")
endif()
SET(HAVE_MC 0)
SET(HAVE_MMALLOC 0)
- SET(MMALLOC_WANT_OVERRIDE_LEGACY 0)
endif()
if(enable_smpi)
### Generate the required headers and scripts
#############################################
-configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE)
-configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h" @ONLY IMMEDIATE)
+# Avoid triggering a (full) rebuild by touching the files if they did not really change
+configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated" @ONLY IMMEDIATE)
+exec_program("${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h")
+exec_program("${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid_config.h")
+file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated)
+file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated)
# We need two versions of the SMPI scripts because they contain the path to the library
# so, it depends of whether SimGrid is installed, or run from the sources (during the build)
-file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH) # Definitions shared amongst all scripts, inlined in each of them
+
+file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH) # Definitions shared amongst all SMPI scripts, inlined in each of them
### SMPI script used when simgrid is installed
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
message("")
message("##########################################")
message("#### Content of src/internal_config.h ####")
+message("##########################################")
file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/src/internal_config.h config_output)
LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8) # Pass the file header
foreach(line ${config_output})
message(" ${line}")
endforeach()
-message("#### end of src/internal_config.h ####")
+message("##########################################")
+message("#### Content of simgrid_config.h ####")
+message("##########################################")
+file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h config_output)
+LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8 9 -1) # Pass the file header
+foreach(line ${config_output})
+ message(" ${line}")
+endforeach()
+message("##########################################")
+message("#### End of configuration headers ####")
message("##########################################")
message("\nConfiguration of package `simgrid':")