Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Strip -f[a-z]+-prefix-map from compiler flags in smpi* scripts.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Dec 2019 12:25:06 +0000 (13:25 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Dec 2019 12:30:43 +0000 (13:30 +0100)
Ref: FG simgrid/simgrid#4 and GH #39.

CMakeLists.txt

index 6146201..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")