Define Git and date constants in executables only (#4681)

This commit is contained in:
nerix
2023-06-17 19:43:39 +02:00
committed by GitHub
parent aff9342647
commit 4b40b9a310
7 changed files with 78 additions and 43 deletions
+34
View File
@@ -38,8 +38,42 @@
# define CHATTERINO_OS "unknown"
#endif
#define CHATTERINO_DECLARE_BUILD_CONSTANTS() \
namespace chatterino::detail::version { \
QString gitHash() \
{ \
return QStringLiteral(CHATTERINO_GIT_HASH); \
} \
QString gitRelease() \
{ \
return QStringLiteral(CHATTERINO_GIT_RELEASE); \
} \
QString gitCommit() \
{ \
return QStringLiteral(CHATTERINO_GIT_COMMIT); \
} \
bool gitModified() \
{ \
return CHATTERINO_GIT_MODIFIED == 1; \
} \
QString cmakeGenDate() \
{ \
return QStringLiteral(CHATTERINO_CMAKE_GEN_DATE); \
} \
} // namespace chatterino::detail::version
namespace chatterino {
namespace detail::version {
extern QString gitHash();
extern QString gitRelease();
extern QString gitCommit();
extern bool gitModified();
extern QString cmakeGenDate();
} // namespace detail::version
class Version
{
public: