diff options
-rw-r--r-- | host/cmake/Modules/UHDBuildInfo.cmake | 5 |
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()))" |