修正autorevision.sh文件换行符导致的执行问题

This commit is contained in:
Lu Qiuwen
2018-10-25 17:08:08 +08:00
parent 0cd191b9e6
commit 1563e1abba
2 changed files with 6 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ file(COPY ${__SOURCE_AUTORESIVISION} DESTINATION ${CMAKE_BINARY_DIR}
WORLD_READ WORLD_EXECUTE)
# execute autorevision.sh to generate version information
execute_process(COMMAND ${__AUTORESIVISION} -t cmake -o ${__VERSION_CACHE} OUTPUT_FILE ${__VERSION_CONFIG} ERROR_QUIET)
execute_process(COMMAND ${__AUTORESIVISION} -t cmake -o ${__VERSION_CACHE} OUTPUT_FILE ${__VERSION_CONFIG})
include(${__VERSION_CONFIG})
# extract major, minor, patch version from git tag
@@ -33,15 +33,10 @@ endif()
set(TFE_VERSION "${TFE_VERSION_MAJOR}.${TFE_VERSION_MINOR}.${TFE_VERSION_PATCH}")
set(TFE_DESCRIBE "${VCS_SHORT_HASH}")
set(TFE_GIT_VERSION "${TFE_VERSION_MAJOR}.${TFE_VERSION_MINOR}.${TFE_VERSION_PATCH}-${TFE_VERSION_BUILD}")
set(TFE_GIT_VERSION "${TFE_VERSION_MAJOR}.${TFE_VERSION_MINOR}.${TFE_VERSION_PATCH}-${TFE_DESCRIBE}")
set(TFE_VAR_VERSION "${TFE_VERSION_MAJOR}_${TFE_VERSION_MINOR}_${TFE_VERSION_PATCH}_${TFE_DESCRIBE}")
# system information
execute_process(COMMAND uname -r OUTPUT_VARIABLE TFE_VERSION_KERNEL)
# print information
message(STATUS "TFE Version: ${TFE_GIT_VERSION}")
message(STATUS "Kernel Version: ${TFE_VERSION_KERNEL}")
add_definitions(-DTFE_GIT_VERSION=\"${TFE_GIT_VERSION}\")
add_definitions(-DTFE_VAR_VERSION=${TFE_VAR_VERSION})

View File

@@ -49,9 +49,11 @@ struct tfe_proxy * g_default_proxy = NULL;
thread_local unsigned int __currect_thread_id = 0;
thread_local void * __currect_default_logger = NULL;
#define TFE_VAR_VERSION_CATTER(v) static __attribute__((__used__)) const char * TFE_VERSION_version_##v = NULL
#define TFE_VAR_VERSION_CATTER(v) __attribute__((__used__)) const char * TFE_VERSION_version_##v = NULL
#define TFE_VAR_VERSION_EXPEND(v) TFE_VAR_VERSION_CATTER(v)
extern "C"
{
/* VERSION TAG */
#ifdef TFE_VAR_VERSION
TFE_VAR_VERSION_EXPEND(TFE_VAR_VERSION);
@@ -60,6 +62,7 @@ static __attribute__((__used__)) const char * TFE_VERSION_version_UNKNOWN = NULL
#endif
#undef TFE_VAR_VERSION_CATTER
#undef TFE_VAR_VERSION_EXPEND
}
/* VERSION STRING */
#ifdef TFE_GIT_VERSION