X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a55549d1f97905cec49c509245ff7a0cc1559a42..661e64114641721802e309fc277b081ea01078c8:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c1da7af87..50075e0b47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/tools/cmake/M project(SimGrid C CXX) +## Save compiler flags preset with environment variables CFLAGS or CXXFLAGS; +## they will used within smpicc, smpicxx. +## Do it early so that we get their genuine values. The same will be done later for Fortran. +set(SMPI_C_FLAGS "${CMAKE_C_FLAGS}") +set(SMPI_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Check for the compiler # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -22,7 +28,6 @@ CHECK_C_COMPILER_FLAG(-fstack-cleaner HAVE_C_STACK_CLEANER) ## Request full debugging flags set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") -set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g") if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7") @@ -80,6 +85,10 @@ if ((NOT DEFINED enable_smpi) OR enable_smpi) set(SMPI_Fortran_LIBS "") set(SMPI_FLANG 1) endif() + set(SMPI_Fortran_FLAGS "${SMPI_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS}") + + ## Request debugging flags for Fortran too + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g") set(SMPI_FORTRAN 1) endif(CMAKE_Fortran_COMPILER)