aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorA. Maitland Bottoms <bottoms@debian.org>2018-11-01 07:49:46 -0700
committermichael-west <michael.west@ettus.com>2018-12-17 13:38:01 -0800
commite123caf8963670eb9d4a3e2677cd1f90b07e6336 (patch)
tree9a0be7033433baeb0b811eb600388fb5e0fcea85
parentpython: populated the tune_result_t binding (diff)
downloaduhd-e123caf8963670eb9d4a3e2677cd1f90b07e6336.tar.xz
uhd-e123caf8963670eb9d4a3e2677cd1f90b07e6336.zip
cmake: Add SOURCE_DATE_EPOCH
Reproducible builds set SOURCE_DATE_EPOCH rather than arbitrary build timestamps. Use it if set, otherwise revert to the old way.
-rw-r--r--host/cmake/Modules/UHDBuildInfo.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/host/cmake/Modules/UHDBuildInfo.cmake b/host/cmake/Modules/UHDBuildInfo.cmake
index 468635b15..e1af7190a 100644
--- a/host/cmake/Modules/UHDBuildInfo.cmake
+++ b/host/cmake/Modules/UHDBuildInfo.cmake
@@ -15,6 +15,11 @@ macro(UHD_LOAD_BUILD_INFO)
# Build date
if(IGNORE_BUILD_DATE)
set(UHD_BUILD_DATE "")
+ elseif(DEFINED ENV{SOURCE_DATE_EPOCH})
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c
+ "import time; print(time.strftime('%a, %d %b %Y %H:%M:%S UTC', time.gmtime($ENV{SOURCE_DATE_EPOCH})))"
+ OUTPUT_VARIABLE UHD_BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
else()
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
"import time; print(time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime()))"