EmbeddedPkg/VirtualRealTimeClockLib: Use SOURCE_DATE_EPOCH

Change VirtualRealTimeClockLib.inf to use SOURCE_DATE_EPOCH
instead of Linux only shell command. This allows this library
to be used in Windows build environments.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
This commit is contained in:
Michael D Kinney
2025-05-19 14:03:41 -07:00
committed by mergify[bot]
parent fcc568ca6e
commit fe52108211
2 changed files with 2 additions and 8 deletions

View File

@ -80,12 +80,7 @@ LibGetTime (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (Status != EFI_INVALID_PARAMETER); ASSERT (Status != EFI_INVALID_PARAMETER);
ASSERT (Status != EFI_BUFFER_TOO_SMALL); ASSERT (Status != EFI_BUFFER_TOO_SMALL);
//
// The following is intended to produce a compilation error on build
// environments where BUILD_EPOCH can not be set from inline shell.
// If you are attempting to use this library on such an environment, please
// contact the edk2 mailing list, so we can try to add support for it.
//
EpochSeconds = BUILD_EPOCH; EpochSeconds = BUILD_EPOCH;
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,

View File

@ -33,6 +33,5 @@
TimeBaseLib TimeBaseLib
UefiRuntimeLib UefiRuntimeLib
# Current usage of this library expects GCC in a UNIX-like shell environment with the date command
[BuildOptions] [BuildOptions]
GCC:*_*_*_CC_FLAGS = -DBUILD_EPOCH=`printenv SOURCE_DATE_EPOCH || date +%s` *_*_*_CC_FLAGS = -DBUILD_EPOCH=$(SOURCE_DATE_EPOCH)