mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-17 23:55:15 +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:
@@ -167,6 +167,7 @@ endif(ARCH_64BITS)
|
||||
add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
file(GLOB SIGNAL_SOURCE_ADAPTER_HEADERS "*.h")
|
||||
list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS)
|
||||
add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
||||
source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
||||
target_link_libraries(signal_source_adapters signal_source_gr_blocks
|
||||
|
||||
@@ -35,6 +35,7 @@ include_directories(
|
||||
)
|
||||
|
||||
file(GLOB SIGNAL_SOURCE_GR_BLOCKS_HEADERS "*.h")
|
||||
list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS)
|
||||
add_library(signal_source_gr_blocks ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS})
|
||||
source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS})
|
||||
target_link_libraries(signal_source_gr_blocks signal_source_lib ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES})
|
||||
|
||||
@@ -26,5 +26,6 @@ include_directories(
|
||||
)
|
||||
|
||||
file(GLOB SIGNAL_SOURCE_LIB_HEADERS "*.h")
|
||||
list(SORT SIGNAL_SOURCE_LIB_HEADERS)
|
||||
add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS})
|
||||
source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS})
|
||||
Reference in New Issue
Block a user