From: Arnaud Giersch Date: Mon, 16 Dec 2019 12:03:40 +0000 (+0100) Subject: Use -ffile-prefix-map with gcc >= 8.0. X-Git-Tag: v3.25~273 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1adb9333fcdbaa2971e673b55bb131e52c8f4f27 Use -ffile-prefix-map with gcc >= 8.0. See https://github.com/simgrid/simgrid/issues/39 --- diff --git a/tools/cmake/Flags.cmake b/tools/cmake/Flags.cmake index e752365d85..b23c24ede7 100644 --- a/tools/cmake/Flags.cmake +++ b/tools/cmake/Flags.cmake @@ -98,7 +98,11 @@ if(CMAKE_COMPILER_IS_GNUCC) message(WARNING "Failed to find relative source directory. Using \".\".") set(RELATIVE_SOURCE_DIR ".") endif() - set(optCFLAGS "${optCFLAGS} -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=${RELATIVE_SOURCE_DIR}") + if (CMAKE_C_COMPILER_VERSION VERSION_LESS "8.0") + set(optCFLAGS "${optCFLAGS} -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=${RELATIVE_SOURCE_DIR}") + else() + set(optCFLAGS "${optCFLAGS} -ffile-prefix-map=${CMAKE_SOURCE_DIR}=${RELATIVE_SOURCE_DIR}") + endif() endif() # Configure LTO