File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ OPTION( CURL "Use curl for HTTP if available" ON)
5050OPTION ( USE_EXT_HTTP_PARSER "Use system HTTP_Parser if available" ON )
5151OPTION ( DEBUG_POOL "Enable debug pool allocator" OFF )
5252OPTION ( ENABLE_WERROR "Enable compilation with -Werror" OFF )
53+ IF (UNIX AND NOT APPLE )
54+ OPTION ( ENABLE_REPRODUCIBLE_BUILDS "Enable reproducible builds" OFF )
55+ ENDIF ()
5356
5457IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
5558 SET ( USE_ICONV ON )
@@ -222,6 +225,12 @@ IF (MSVC)
222225 SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} " )
223226 SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} " )
224227ELSE ()
228+ IF (ENABLE_REPRODUCIBLE_BUILDS)
229+ SET (CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>" )
230+ SET (CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> Dq <TARGET> <LINK_FLAGS> <OBJECTS>" )
231+ SET (CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>" )
232+ ENDIF ()
233+
225234 SET (CMAKE_C_FLAGS "-D_GNU_SOURCE ${CMAKE_C_FLAGS} " )
226235
227236 MACRO (ENABLE_WARNINGS flag)
Original file line number Diff line number Diff line change @@ -207,16 +207,18 @@ def write(self):
207207 return False
208208
209209 with open (output , 'w' ) as data :
210- for module in self .modules .values ():
210+ modules = sorted (self .modules .values (), key = lambda module : module .name )
211+
212+ for module in modules :
211213 t = Module .DeclarationTemplate (module )
212214 data .write (t .render ())
213215
214- for module in self . modules . values () :
216+ for module in modules :
215217 t = Module .CallbacksTemplate (module )
216218 data .write (t .render ())
217219
218220 suites = "static struct clar_suite _clar_suites[] = {" + ',' .join (
219- Module .InfoTemplate (module ).render () for module in sorted ( self . modules . values (), key = lambda module : module . name )
221+ Module .InfoTemplate (module ).render () for module in modules
220222 ) + "\n };\n "
221223
222224 data .write (suites )
You can’t perform that action at this time.
0 commit comments