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