build: add CONFIG_APP_REPRODUCIBLE_BUILD menuconfig option to produce reproducible binaries

This commit is contained in:
Fu Hanxi
2021-10-09 15:42:14 +08:00
parent a65de0ab1f
commit 9919b75ec1
8 changed files with 63 additions and 2 deletions
+7 -1
View File
@@ -147,7 +147,13 @@ endif()
if(NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS 8.0.0)
if(CONFIG_COMPILER_HIDE_PATHS_MACROS)
list(APPEND compile_options "-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.")
list(APPEND compile_options "-fmacro-prefix-map=${IDF_PATH}=IDF")
list(APPEND compile_options "-fmacro-prefix-map=${IDF_PATH}=/IDF")
endif()
if(CONFIG_APP_REPRODUCIBLE_BUILD)
list(APPEND compile_options "-fdebug-prefix-map=${IDF_PATH}=/IDF")
list(APPEND compile_options "-fdebug-prefix-map=${PROJECT_DIR}=/IDF_PROJECT")
list(APPEND compile_options "-fdebug-prefix-map=${BUILD_DIR}=/IDF_BUILD")
endif()
endif()