diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-18 16:09:51 -0700 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-18 16:09:51 -0700 |
commit | dee470bf63c25c3d99ea89e9d9f5979ab01d53bb (patch) | |
tree | 0b8a3a91c89e0ad6713e62702dfc23bf875ec9b7 /crawl-ref/source/initfile.cc | |
parent | b3475474824eb75feb901ed9fa3b5826626a185b (diff) | |
download | crawl-ref-dee470bf63c25c3d99ea89e9d9f5979ab01d53bb.tar.gz crawl-ref-dee470bf63c25c3d99ea89e9d9f5979ab01d53bb.zip |
Add compilation information to Version namespace
The Version namespace now provides the compiler which was used, the OS,
machine type and processor type the compilation was done on, and the
CFLAGS, CFLAGS_L and LDFLAGS which were used. If GCC was the compiler,
it also provides the compiler version.
This information is included in crash reports, and can be dumped using
the new command line option "-version".
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r-- | crawl-ref/source/initfile.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 162b97fd2f..6c9072505a 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -3514,6 +3514,7 @@ enum commandline_option_type { CLO_ARENA, CLO_TEST, CLO_HELP, + CLO_VERSION, CLO_NOPS }; @@ -3521,7 +3522,7 @@ enum commandline_option_type { static const char *cmd_ops[] = { "scores", "name", "species", "job", "plain", "dir", "rc", "rcdir", "tscores", "vscores", "scorefile", "morgue", "macro", - "mapstat", "arena", "test", "help" + "mapstat", "arena", "test", "help", "version" }; const int num_cmd_ops = CLO_NOPS; @@ -3554,6 +3555,13 @@ std::string find_executable_path() return std::string(tempPath); } +static void _print_version() +{ + printf("Crawl version %s" EOL, Version::Long().c_str()); + + printf("%s", compilation_info().c_str()); +} + bool parse_args( int argc, char **argv, bool rc_only ) { COMPILE_CHECK(ARRAYSZ(cmd_ops) == CLO_NOPS, c1); @@ -3798,6 +3806,10 @@ bool parse_args( int argc, char **argv, bool rc_only ) case CLO_HELP: // Shouldn't happen. return (false); + + case CLO_VERSION: + _print_version(); + end(0); } // Update position. |