Skip to content

Commit

Permalink
Added git commit ID to X-RAAS version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
skiselkov committed Aug 2, 2017
1 parent 0207f7f commit 7ad973a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions qmake/qmake.pro
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ DEFINES += _GNU_SOURCE DEBUG _FILE_OFFSET_BITS=64 _USE_MATH_DEFINES

# Latest X-Plane APIs. No legacy support needed.
DEFINES += XPLM200 XPLM210
DEFINES += XRAAS2_BUILD_VERSION=\'\"$$system("git rev-parse --short HEAD")\"\'

# Aircraft-specific defines
DEFINES += ACF_TYPE=$$[ACF_TYPE]
Expand Down
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DAPL=0 -DIBM=0 -DLIN=1")
endif()

# Yes, we need to strip a trailing newline from command output. CMake is
# "smart" like that...
execute_process(COMMAND git rev-parse --short HEAD
OUTPUT_VARIABLE XRAAS2_BUILD_VERSION)
string(REGEX REPLACE "\n$" "" XRAAS2_BUILD_VERSION "${XRAAS2_BUILD_VERSION}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
-DXRAAS2_BUILD_VERSION='\"${XRAAS2_BUILD_VERSION}\"'")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")

#linking
Expand Down
2 changes: 1 addition & 1 deletion src/xraas2.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
extern "C" {
#endif

#define XRAAS2_VERSION "2.1"
#define XRAAS2_VERSION "2.1-" XRAAS2_BUILD_VERSION
#define TATL_FIELD_ELEV_UNSET -1000000
#define RWY_PROXIMITY_TIME_FACT 2 /* seconds */
#define ARPT_LOAD_LIMIT NM2MET(8) /* meters */
Expand Down

0 comments on commit 7ad973a

Please sign in to comment.