zephyr/subsys/bindesc/bindesc_build_time.c
Pieter De Gendt 3102fdc8c1 bindesc: Update build time without re-running cmake entirely
With CONFIG_BINDESC_BUILD_TIME_ALWAYS_REBUILD a re-run was called for
the entire project.
This can result in issues with the zephyr linker mechanism.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-29 15:08:39 +00:00

53 lines
2.1 KiB
C

/*
* Copyright (c) 2023 Yonatan Schachter
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/bindesc.h>
/* Include generated header */
#include <bindesc_build_time.h>
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR)
BINDESC_UINT_DEFINE(build_time_year, BINDESC_ID_BUILD_TIME_YEAR, BUILD_TIME_YEAR);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH)
BINDESC_UINT_DEFINE(build_time_month, BINDESC_ID_BUILD_TIME_MONTH, BUILD_TIME_MONTH);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY)
BINDESC_UINT_DEFINE(build_time_day, BINDESC_ID_BUILD_TIME_DAY, BUILD_TIME_DAY);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR)
BINDESC_UINT_DEFINE(build_time_hour, BINDESC_ID_BUILD_TIME_HOUR, BUILD_TIME_HOUR);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE)
BINDESC_UINT_DEFINE(build_time_minute, BINDESC_ID_BUILD_TIME_MINUTE, BUILD_TIME_MINUTE);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND)
BINDESC_UINT_DEFINE(build_time_second, BINDESC_ID_BUILD_TIME_SECOND, BUILD_TIME_SECOND);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX)
BINDESC_UINT_DEFINE(build_time_unix, BINDESC_ID_BUILD_TIME_UNIX, BUILD_TIME_UNIX);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING)
BINDESC_STR_DEFINE(build_date_time_string, BINDESC_ID_BUILD_DATE_TIME_STRING,
BUILD_DATE_TIME_STRING);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING)
BINDESC_STR_DEFINE(build_date_string, BINDESC_ID_BUILD_DATE_STRING, BUILD_DATE_STRING);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING)
BINDESC_STR_DEFINE(build_time_string, BINDESC_ID_BUILD_TIME_STRING, BUILD_TIME_STRING);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING) */