From b85af075b7d654b309b98905e3693483264186c6 Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Fri, 2 Oct 2020 02:29:23 +0200 Subject: [PATCH] Build: Emit paths in macros and debug sections relative to repo root To avoid including paths from the build environment in the binaries. A step towards having reproducible builds. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c960268e42f..59b6d14b17c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,6 +202,7 @@ set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared") #FIXME: -fstack-protector set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -g1 -fno-exceptions -fno-rtti -Wno-address-of-packed-member -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough -Wno-nonnull-compare -Wno-deprecated-copy -Wno-expansion-to-defined") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffile-prefix-map=${CMAKE_SOURCE_DIR}=.") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG -DSANITIZE_PTRS") add_link_options(--sysroot ${CMAKE_BINARY_DIR}/Root)