mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-10-12 10:41:50 +00:00
Improve package reproducibility
Packages using CMake often use file(GLOB ...) to retrieve a list of source files. As this is based on readdir(), the resulting file list is unsorted. A common use case is to pass this list directly to add_executable or add_library. But as the order is unpredictable, the binaries are not reproducible (because the order in which the objects are linked will vary). See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824263
This commit is contained in:
@@ -48,6 +48,7 @@ include_directories(
|
||||
)
|
||||
|
||||
file(GLOB TRACKING_ADAPTER_HEADERS "*.h")
|
||||
list(SORT TRACKING_ADAPTER_HEADERS)
|
||||
add_library(tracking_adapters ${TRACKING_ADAPTER_SOURCES} ${TRACKING_ADAPTER_HEADERS})
|
||||
source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS})
|
||||
target_link_libraries(tracking_adapters tracking_gr_blocks gnss_sp_libs)
|
||||
|
||||
@@ -54,6 +54,7 @@ if(ENABLE_GENERIC_ARCH)
|
||||
endif(ENABLE_GENERIC_ARCH)
|
||||
|
||||
file(GLOB TRACKING_GR_BLOCKS_HEADERS "*.h")
|
||||
list(SORT TRACKING_GR_BLOCKS_HEADERS)
|
||||
add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS})
|
||||
source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS})
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ endif(SSE3_AVAILABLE)
|
||||
|
||||
|
||||
file(GLOB TRACKING_LIB_HEADERS "*.h")
|
||||
list(SORT TRACKING_LIB_HEADERS)
|
||||
add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS})
|
||||
source_group(Headers FILES ${TRACKING_LIB_HEADERS})
|
||||
target_link_libraries(tracking_lib ${OPT_TRACKING_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES})
|
||||
|
||||
Reference in New Issue
Block a user