mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 23:33:35 +08:00
travis-ci proper git version
This commit is contained in:
committed by
Lorenz Meier
parent
e064cb645e
commit
a4c7fe50a7
@@ -44,6 +44,7 @@ addons:
|
|||||||
- zlib1g-dev
|
- zlib1g-dev
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
|
- cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags
|
||||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||||
pushd .
|
pushd .
|
||||||
&& cd ~ && mkdir gcc && cd gcc
|
&& cd ~ && mkdir gcc && cd gcc
|
||||||
|
|||||||
@@ -776,21 +776,21 @@ function(px4_create_git_hash_header)
|
|||||||
REQUIRED HEADER
|
REQUIRED HEADER
|
||||||
ARGN ${ARGN})
|
ARGN ${ARGN})
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND git describe --tags
|
COMMAND git describe --always --tags
|
||||||
OUTPUT_VARIABLE git_tag
|
OUTPUT_VARIABLE git_tag
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
#message(STATUS "GIT_TAG = ${git_tag}")
|
message(STATUS "GIT_TAG = ${git_tag}")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND git rev-parse HEAD
|
COMMAND git rev-parse --verify HEAD
|
||||||
OUTPUT_VARIABLE git_desc
|
OUTPUT_VARIABLE git_version
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
#message(STATUS "GIT_DESC = ${git_desc}")
|
#message(STATUS "GIT_VERSION = ${git_version}")
|
||||||
set(git_desc_short)
|
set(git_version_short)
|
||||||
string(SUBSTRING ${git_desc} 1 16 git_desc_short)
|
string(SUBSTRING ${git_version} 1 16 git_version_short)
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/templates/build_git_version.h.in ${HEADER} @ONLY)
|
configure_file(${CMAKE_SOURCE_DIR}/cmake/templates/build_git_version.h.in ${HEADER} @ONLY)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Auto Magically Generated file */
|
/* Auto Magically Generated file */
|
||||||
/* Do not edit! */
|
/* Do not edit! */
|
||||||
#define PX4_GIT_VERSION_STR "@git_desc@"
|
#define PX4_GIT_VERSION_STR "@git_version@"
|
||||||
#define PX4_GIT_VERSION_BINARY 0x@git_desc_short@
|
#define PX4_GIT_VERSION_BINARY 0x@git_version_short@
|
||||||
#define PX4_GIT_TAG_STR "@git_tag@"
|
#define PX4_GIT_TAG_STR "@git_tag@"
|
||||||
|
|||||||
Reference in New Issue
Block a user