More reproducible builds

This commit is contained in:
Alexey Milovidov 2021-11-26 05:44:08 +03:00
parent 06c760409b
commit 79f6f5a202
3 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,12 @@
set (FULL_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
set (FULL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
set (FULL_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
message (STATUS "compiler C = ${CMAKE_C_COMPILER} ${FULL_C_FLAGS}")
message (STATUS "compiler CXX = ${CMAKE_CXX_COMPILER} ${FULL_CXX_FLAGS}")
message (STATUS "LINKER_FLAGS = ${FULL_EXE_LINKER_FLAGS}")
# Reproducible builds
string (REPLACE "${CMAKE_SOURCE_DIR}" "." FULL_C_FLAGS_NORMALIZED "${FULL_C_FLAGS}")
string (REPLACE "${CMAKE_SOURCE_DIR}" "." FULL_CXX_FLAGS_NORMALIZED "${FULL_CXX_FLAGS}")
string (REPLACE "${CMAKE_SOURCE_DIR}" "." FULL_EXE_LINKER_FLAGS_NORMALIZED "${FULL_EXE_LINKER_FLAGS}")

View File

@ -6,7 +6,6 @@ include(${ClickHouse_SOURCE_DIR}/cmake/embed_binary.cmake)
set (CONFIG_BUILD "${CMAKE_CURRENT_BINARY_DIR}/StorageSystemBuildOptions.generated.cpp")
get_property (BUILD_COMPILE_DEFINITIONS DIRECTORY ${ClickHouse_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS)
get_property (BUILD_INCLUDE_DIRECTORIES DIRECTORY ${ClickHouse_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
get_property(TZDATA_VERSION GLOBAL PROPERTY TZDATA_VERSION_PROP)

View File

@ -17,11 +17,10 @@ const char * auto_config_build[]
"C_COMPILER_VERSION", "@CMAKE_C_COMPILER_VERSION@",
"CXX_COMPILER", "@CMAKE_CXX_COMPILER@",
"CXX_COMPILER_VERSION", "@CMAKE_CXX_COMPILER_VERSION@",
"C_FLAGS", "@FULL_C_FLAGS@",
"CXX_FLAGS", "@FULL_CXX_FLAGS@",
"LINK_FLAGS", "@CMAKE_EXE_LINKER_FLAGS@",
"C_FLAGS", "@FULL_C_FLAGS_NORMALIZED@",
"CXX_FLAGS", "@FULL_CXX_FLAGS_NORMALIZED@",
"LINK_FLAGS", "@CMAKE_EXE_LINKER_FLAGS_NORMALIZED@",
"BUILD_COMPILE_DEFINITIONS", "@BUILD_COMPILE_DEFINITIONS@",
"BUILD_INCLUDE_DIRECTORIES", "@BUILD_INCLUDE_DIRECTORIES@",
"STATIC", "@USE_STATIC_LIBRARIES@",
"SPLIT_BINARY", "@CLICKHOUSE_SPLIT_BINARY@",
"USE_EMBEDDED_COMPILER", "@USE_EMBEDDED_COMPILER@",