mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-04-22 14:51:26 +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:
@@ -35,6 +35,7 @@ include_directories(
|
||||
)
|
||||
|
||||
file(GLOB OBS_ADAPTER_HEADERS "*.h")
|
||||
list(SORT OBS_ADAPTER_HEADERS)
|
||||
add_library(obs_adapters ${OBS_ADAPTER_SOURCES} ${OBS_ADAPTER_HEADERS})
|
||||
source_group(Headers FILES ${OBS_ADAPTER_HEADERS})
|
||||
target_link_libraries(obs_adapters obs_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES})
|
||||
|
||||
@@ -36,6 +36,7 @@ include_directories(
|
||||
)
|
||||
|
||||
file(GLOB OBS_GR_BLOCKS_HEADERS "*.h")
|
||||
list(SORT OBS_GR_BLOCKS_HEADERS)
|
||||
add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS})
|
||||
source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS})
|
||||
add_dependencies(obs_gr_blocks glog-${glog_RELEASE} armadillo-${armadillo_RELEASE})
|
||||
|
||||
Reference in New Issue
Block a user