From 85b07a94d7d0c54e221dbbb8333870beb47bb3ac Mon Sep 17 00:00:00 2001 From: Naram Qashat Date: Mon, 28 Jun 2010 01:28:51 -0400 Subject: Fix version system so it doesn't cause the entire build tree to get rebuilt just because version.h gets regenerated, thanks to Adam for initial patch. --- src/main.cpp | 11 +++++++++++ src/modules.cpp | 5 +++++ 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index c00b3a8f0..e1b3c1ee3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,6 +26,7 @@ #include "services.h" #include "timers.h" #include "modules.h" +#include "version.h" // getrlimit. #ifndef _WIN32 @@ -570,3 +571,13 @@ int main(int ac, char **av, char **envp) return 0; } + +inline std::string Anope::Version() +{ + return stringify(VERSION_MAJOR) + "." + stringify(VERSION_MINOR) + "." + stringify(VERSION_PATCH) + VERSION_EXTRA + " (" + stringify(VERSION_BUILD) + ")"; +} + +inline std::string Anope::Build() +{ + return std::string("build #") + stringify(BUILD) + ", compiled " + compiled; +} diff --git a/src/modules.cpp b/src/modules.cpp index c32544aa4..fda941e50 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -407,3 +407,8 @@ void ModuleRunTimeDirCleanUp() #endif Alog(LOG_DEBUG) << "Module run time directory has been cleaned out"; } + +Version Module::GetVersion() +{ + return Version(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); +} -- cgit