From: Martin Quinson Date: Tue, 1 Aug 2017 20:44:24 +0000 (+0200) Subject: Reduces the amount of build env leaked in the binaries (see #39) X-Git-Tag: v3_17~294 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2aa123eb6e39b46ca1061ecf6b65f215033d00d3?hp=3b68ec95a7648e14307f1d31699c14532cfd86ee;ds=sidebyside Reduces the amount of build env leaked in the binaries (see #39) --- diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index a85f6cd412..a6ec7a90b9 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -79,6 +79,11 @@ if(enable_compile_optimizations AND CMAKE_COMPILER_IS_GNUCC set(optCFLAGS "${optCFLAGS} -finline-functions ") endif() +# Do not leak the current directory into the binaries +if(CMAKE_COMPILER_IS_GNUCC) + set(optCFLAGS "${optCFLAGS} -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.") +endif() + # Configure LTO # NOTE, cmake 3.0 has a INTERPROCEDURAL_OPTIMIZATION target # property for this (http://www.cmake.org/cmake/help/v3.0/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html)