From 9bbf83a528b048e482b403c79f119b0ba658f51c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 18 Dec 2019 13:25:06 +0100 Subject: [PATCH] Strip -f[a-z]+-prefix-map from compiler flags in smpi* scripts. Ref: FG simgrid/simgrid#4 and GH #39. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6146201582..5b0f0da654 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") -- 2.20.1