Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Strip -f[a-z]+-prefix-map from compiler flags in smpi* scripts.
[simgrid.git] / CMakeLists.txt
index 193567c..5b0f0da 100644 (file)
@@ -29,8 +29,8 @@ 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}")
+string(REGEX REPLACE " *-f[a-z]+-prefix-map=[^ ]*" "" SMPI_C_FLAGS "${CMAKE_C_FLAGS}")
+string(REGEX REPLACE " *-f[a-z]+-prefix-map=[^ ]*" "" SMPI_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 #     Check for the compiler        #
@@ -101,7 +101,7 @@ 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}")
+    string(REGEX REPLACE " *-f[a-z]+-prefix-map=[^ ]*" "" SMPI_Fortran_FLAGS "${SMPI_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS}")
 
     ## Request debugging flags for Fortran too
     set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g")
@@ -593,6 +593,7 @@ endif()
 set(generated_headers_to_install
   ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h
   ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid/config.h
+  ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid/version.h
   )
 
 set(generated_headers  ${CMAKE_CURRENT_BINARY_DIR}/src/internal_config.h )