Skip to content

Commit

Permalink
build: date now compiled alongside version
Browse files Browse the repository at this point in the history
This should at the very least ensure that any changes to the git version
will trigger an update of the build date reported. Also ensure all dates
reported reference the same variable, rather than each reporting
potentially different __DATE__ macros.
  • Loading branch information
jdtournier committed May 9, 2018
1 parent eabb1ec commit 9da34f1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ update_git_version (mrtrix_dir[-1], os.path.join (lib_dir, 'version.cpp'), '''
namespace MR {
namespace App {
const char* mrtrix_version = "%%%";
const char* build_date = __DATE__;
}
}
''')
Expand Down
3 changes: 1 addition & 2 deletions core/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ namespace MR
bool terminal_use_colour = true;

const char* project_version = nullptr;
const char* build_date = __DATE__;

int argc = 0;
const char* const* argv = nullptr;
Expand Down Expand Up @@ -564,7 +563,7 @@ namespace MR
{
std::string version =
"== " + App::NAME + " " + ( project_version ? project_version : mrtrix_version ) + " ==\n" +
str(8*sizeof (size_t)) + " bit " + MRTRIX_BUILD_TYPE + ", built " __DATE__
str(8*sizeof (size_t)) + " bit " + MRTRIX_BUILD_TYPE + ", built " + build_date
+ ( project_version ? std::string(" against MRtrix ") + mrtrix_version : std::string("") )
+ ", using Eigen " + str(EIGEN_WORLD_VERSION) + "." + str(EIGEN_MAJOR_VERSION) + "." + str(EIGEN_MINOR_VERSION) + "\n"
"Author(s): " + AUTHOR + "\n" +
Expand Down
2 changes: 0 additions & 2 deletions core/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

extern "C" void R_main (int* cmdline_argc, char** cmdline_argv)
{
::MR::App::build_date = __DATE__;
#ifdef MRTRIX_PROJECT_VERSION
::MR::App::project_version = MRTRIX_PROJECT_VERSION;
#endif
Expand Down Expand Up @@ -75,7 +74,6 @@ int main (int cmdline_argc, char** cmdline_argv)
mxcsr |= (1<<6); // denormals-are-zero
_mm_setcsr (mxcsr);
#endif
::MR::App::build_date = __DATE__;
#ifdef MRTRIX_PROJECT_VERSION
::MR::App::project_version = MRTRIX_PROJECT_VERSION;
#endif
Expand Down

0 comments on commit 9da34f1

Please sign in to comment.