From b80f849b93e79a6dd5afadbb31cba3d94880f4ed Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 26 Nov 2021 04:55:17 +0300 Subject: [PATCH] Reproducible builds --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1192c747347..2ac02fe2aef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,9 +169,7 @@ endif () include (cmake/check_flags.cmake) include (cmake/add_warning.cmake) -if (NOT MSVC) - set (COMMON_WARNING_FLAGS "${COMMON_WARNING_FLAGS} -Wall") # -Werror and many more is also added inside cmake/warnings.cmake -endif () +set (COMMON_WARNING_FLAGS "${COMMON_WARNING_FLAGS} -Wall") # -Werror and many more is also added inside cmake/warnings.cmake if (COMPILER_CLANG) # clang: warning: argument unused during compilation: '-specs=/usr/share/dpkg/no-pie-compile.specs' [-Wunused-command-line-argument] @@ -312,6 +310,9 @@ include(cmake/cpu_features.cmake) # Enable it explicitly. set (COMPILER_FLAGS "${COMPILER_FLAGS} -fasynchronous-unwind-tables") +# Reproducible builds +set (COMPILER_FLAGS "${COMPILER_FLAGS} -ffile-prefix-map=${CMAKE_SOURCE_DIR}=.") + if (${CMAKE_VERSION} VERSION_LESS "3.12.4") # CMake < 3.12 doesn't support setting 20 as a C++ standard version. # We will add C++ standard controlling flag in CMAKE_CXX_FLAGS manually for now.