Skip to content

Commit d92da47

Browse files
committed
Improve --version output to include Lua(JIT) version
1 parent 7f25823 commit d92da47

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/main.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
4747
#include "gui/guiEngine.h"
4848
#include "gui/mainmenumanager.h"
4949
#endif
50-
5150
#ifdef HAVE_TOUCHSCREENGUI
5251
#include "gui/touchscreengui.h"
5352
#endif
5453

54+
// for version information only
55+
extern "C" {
56+
#if USE_LUAJIT
57+
#include <luajit.h>
58+
#else
59+
#include <lua.h>
60+
#endif
61+
}
62+
5563
#if !defined(SERVER) && \
5664
(IRRLICHT_VERSION_MAJOR == 1) && \
5765
(IRRLICHT_VERSION_MINOR == 8) && \
@@ -350,6 +358,11 @@ static void print_version()
350358
<< " (" << porting::getPlatformName() << ")" << std::endl;
351359
#ifndef SERVER
352360
std::cout << "Using Irrlicht " IRRLICHT_SDK_VERSION << std::endl;
361+
#endif
362+
#if USE_LUAJIT
363+
std::cout << "Using " << LUAJIT_VERSION << std::endl;
364+
#else
365+
std::cout << "Using " << LUA_RELEASE << std::endl;
353366
#endif
354367
std::cout << g_build_info << std::endl;
355368
}

src/version.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ const char *g_version_hash = VERSION_GITHASH;
3333
const char *g_build_info =
3434
"BUILD_TYPE=" BUILD_TYPE "\n"
3535
"RUN_IN_PLACE=" STR(RUN_IN_PLACE) "\n"
36+
"USE_CURL=" STR(USE_CURL) "\n"
37+
#ifndef SERVER
3638
"USE_GETTEXT=" STR(USE_GETTEXT) "\n"
3739
"USE_SOUND=" STR(USE_SOUND) "\n"
38-
"USE_CURL=" STR(USE_CURL) "\n"
3940
"USE_FREETYPE=" STR(USE_FREETYPE) "\n"
40-
"USE_LUAJIT=" STR(USE_LUAJIT) "\n"
41+
#endif
4142
"STATIC_SHAREDIR=" STR(STATIC_SHAREDIR)
4243
#if USE_GETTEXT && defined(STATIC_LOCALEDIR)
4344
"\n" "STATIC_LOCALEDIR=" STR(STATIC_LOCALEDIR)

0 commit comments

Comments
 (0)