Use updated version.h if available.
Add single fallback header if version.h is missing.
This commit is contained in:
parent
a6458c2ed6
commit
1dbe833579
4 changed files with 35 additions and 5 deletions
16
src/Include/no_version.h
Normal file
16
src/Include/no_version.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef FG_NO_VERSION_H
|
||||
#define FG_NO_VERSION_H
|
||||
|
||||
// version.h is generated by the build system for official builds of
|
||||
// FlightGear. To avoid complicating the life of regular developers,
|
||||
// especially on Windows, we set HAVE_VERSION_H if version.h is generated.
|
||||
// If that define is not set, we include this file instead, which provides
|
||||
// placeholder values instead.
|
||||
|
||||
#define FLIGHTGEAR_VERSION "development " __DATE__
|
||||
|
||||
#define HUDSON_BUILD_NUMBER 0
|
||||
#define HUDSON_BUILD_ID "none"
|
||||
#define REVISION "unknown"
|
||||
|
||||
#endif
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#define FLIGHTGEAR_VERSION "@VERSION@"
|
||||
|
||||
#define HUDSON_BUILD_NUMBER "@HUDSON_BUILD_NUMBER@"
|
||||
#define HUDSON_BUILD_NUMBER @HUDSON_BUILD_NUMBER@
|
||||
#define HUDSON_BUILD_ID "@HUDSON_BUILD_ID@"
|
||||
#define REVISION "@REVISION@"
|
||||
|
||||
|
|
|
@ -76,9 +76,13 @@ using std::string;
|
|||
|
||||
#include <Airports/runways.hxx>
|
||||
#include <Airports/simple.hxx>
|
||||
#ifndef _MSC_VER
|
||||
|
||||
#ifdef HAVE_VERSION_H
|
||||
# include <Include/version.h>
|
||||
#else
|
||||
# include <Include/no_version.h>
|
||||
#endif
|
||||
|
||||
#include <Main/fg_props.hxx>
|
||||
#include <Main/globals.hxx>
|
||||
#include "instrument_mgr.hxx"
|
||||
|
|
|
@ -64,8 +64,10 @@ using std::cout;
|
|||
using std::cerr;
|
||||
using std::endl;
|
||||
|
||||
#ifndef VERSION
|
||||
#define VERSION "CVS "__DATE__
|
||||
#ifdef HAVE_VERSION_H
|
||||
# include <Include/version.h>
|
||||
#else
|
||||
# include <Include/no_version.h>
|
||||
#endif
|
||||
|
||||
#define NEW_DEFAULT_MODEL_HZ 120
|
||||
|
@ -233,6 +235,12 @@ fgSetDefaults ()
|
|||
fgSetString("/sim/multiplay/txhost", "0");
|
||||
fgSetInt("/sim/multiplay/rxport", 0);
|
||||
fgSetInt("/sim/multiplay/txport", 0);
|
||||
|
||||
fgSetString("/sim/version/flightgear", FLIGHTGEAR_VERSION);
|
||||
//fgSetString("/sim/version/simgear", FLIGHTGEAR_VERSION);
|
||||
fgSetString("/sim/version/revision", REVISION);
|
||||
fgSetInt("/sim/version/build-number", HUDSON_BUILD_NUMBER);
|
||||
fgSetString("/sim/version/build-id", HUDSON_BUILD_ID);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -1208,7 +1216,9 @@ fgOptParking( const char *arg )
|
|||
static int
|
||||
fgOptVersion( const char *arg )
|
||||
{
|
||||
cerr << "FlightGear version: " << VERSION << endl;
|
||||
cerr << "FlightGear version: " << FLIGHTGEAR_VERSION << endl;
|
||||
cerr << "Revision: " << REVISION << endl;
|
||||
cerr << "Build-Id: " << HUDSON_BUILD_ID << endl;
|
||||
cerr << "FG_ROOT=" << globals->get_fg_root() << endl;
|
||||
cerr << "FG_HOME=" << fgGetString("/sim/fg-home") << endl;
|
||||
cerr << "FG_SCENERY=";
|
||||
|
|
Loading…
Reference in a new issue