enable-repro-builds.patch 876 B

1234567891011121314151617181920
  1. Description: Enable reproducible builds by default.
  2. Author: Utkarsh Gupta <utkarsh@debian.org>
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -188,6 +188,13 @@
  6. SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
  7. SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
  8. SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL}")
  9. +
  10. + # Enable reproducible builds by default
  11. + SET(CMAKE_C_FLAGS "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=. ${CMAKE_C_FLAGS}")
  12. + SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")
  13. + SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> Dq <TARGET> <LINK_FLAGS> <OBJECTS>")
  14. + SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")
  15. +
  16. ELSE ()
  17. IF (ENABLE_REPRODUCIBLE_BUILDS)
  18. SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")