From dd1278c6f9d3f6f18b205a178bc867f5d5459b6c Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 26 Aug 2020 19:08:07 +0800 Subject: [PATCH] TD-1090 remove version.c and add version to taos.dll --- cmake/version.inc | 42 +++++++++++++++++++++++++++++++++++++++ src/client/CMakeLists.txt | 6 ++++-- src/client/src/taos.rc.in | 31 +++++++++++++++++++++++++++++ src/util/src/version.c | 7 ------- src/util/src/version.c.in | 7 +++++++ 5 files changed, 84 insertions(+), 9 deletions(-) create mode 100644 cmake/version.inc create mode 100644 src/client/src/taos.rc.in delete mode 100644 src/util/src/version.c create mode 100644 src/util/src/version.c.in diff --git a/cmake/version.inc b/cmake/version.inc new file mode 100644 index 0000000000..8c02520142 --- /dev/null +++ b/cmake/version.inc @@ -0,0 +1,42 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +PROJECT(TDengine) + +SET(TD_VER_1 "2") +SET(TD_VER_2 "0") +SET(TD_VER_3 "2") +SET(TD_VER_4 "3") +SET(TD_VER_GIT "d711657139620f6c50f362597020705b8ad26bd2") +SET(TD_VER_GIT_INTERNAL "1d74ae24c541ffbb280e8630883c0236cd45f8c7") + +SET(TD_VER_VERTYPE "stable") +SET(TD_VER_CPUTYPE "x64") +SET(TD_VER_OSTYPE "Linux") + +SET(TD_VER_COMPATIBLE "2.0.0.0") +STRING(TIMESTAMP TD_VER_DATE "%Y-%m-%d %H:%M:%S") + +IF (TD_LINUX_64) + SET(TD_VER_CPUTYPE "x64") +ENDIF () + +IF (TD_LINUX_32) + SET(TD_VER_CPUTYPE "x86") +ENDIF () + +IF (TD_ARM_64) + SET(TD_VER_CPUTYPE "aarch64") +ENDIF () + +IF (TD_ARM_32) + SET(TD_VER_CPUTYPE "aarch32") +ENDIF () + +IF (TD_WINDOWS_64) + SET(TD_VER_CPUTYPE "x64") +ENDIF () + +IF (TD_WINDOWS_32) + SET(TD_VER_CPUTYPE "x86") +ENDIF () + +CONFIGURE_FILE("${TD_COMMUNITY_DIR}/src/util/src/version.c.in" "${TD_COMMUNITY_DIR}/src/util/src/version.c") diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index d5cbf3cab6..5b5fb3435d 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -35,12 +35,14 @@ IF (TD_LINUX) ELSEIF (TD_WINDOWS) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/windows) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/windows/win32) - + + CONFIGURE_FILE("${TD_COMMUNITY_DIR}/src/client/src/taos.rc.in" "${TD_COMMUNITY_DIR}/src/client/src/taos.rc") + ADD_LIBRARY(taos_static STATIC ${SRC}) TARGET_LINK_LIBRARIES(taos_static trpc tutil query) # generate dynamic library (*.dll) - ADD_LIBRARY(taos SHARED ${SRC}) + ADD_LIBRARY(taos SHARED ${SRC} ${TD_COMMUNITY_DIR}/src/client/src/taos.rc) IF (NOT TD_GODLL) SET_TARGET_PROPERTIES(taos PROPERTIES LINK_FLAGS /DEF:${TD_COMMUNITY_DIR}/src/client/src/taos.def) ENDIF () diff --git a/src/client/src/taos.rc.in b/src/client/src/taos.rc.in new file mode 100644 index 0000000000..05dbd9bb7d --- /dev/null +++ b/src/client/src/taos.rc.in @@ -0,0 +1,31 @@ +1 VERSIONINFO + FILEVERSION ${TD_VER_1}, ${TD_VER_2}, ${TD_VER_3} + PRODUCTVERSION ${TD_VER_1}, ${TD_VER_2}, ${TD_VER_3} + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "Native C Driver for TDengine" + VALUE "FileVersion", "${TD_VER_1}, ${TD_VER_2}, ${TD_VER_3}" + VALUE "InternalName", "taos.dll(${TD_VER_CPUTYPE})" + VALUE "LegalCopyright", "Copyright (C) 2020 TAOS Data" + VALUE "OriginalFilename", "" + VALUE "ProductName", "taos.dll(${TD_VER_CPUTYPE})" + VALUE "ProductVersion", "${TD_VER_1}.${TD_VER_2}.${TD_VER_3}.${TD_VER_4}" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END \ No newline at end of file diff --git a/src/util/src/version.c b/src/util/src/version.c deleted file mode 100644 index 6f7b29ebb9..0000000000 --- a/src/util/src/version.c +++ /dev/null @@ -1,7 +0,0 @@ -char version[12] = "2.0.2.0"; -char compatible_version[12] = "2.0.0.0"; -char gitinfo[48] = "d711657139620f6c50f362597020705b8ad26bd2"; -char gitinfoOfInternal[48] = "1d74ae24c541ffbb280e8630883c0236cd45f8c7"; -char buildinfo[64] = "Built by root at 2020-08-24 16:31"; - -void libtaos_2_0_2_0_Linux_x64_beta() {}; diff --git a/src/util/src/version.c.in b/src/util/src/version.c.in new file mode 100644 index 0000000000..c7aea2afb1 --- /dev/null +++ b/src/util/src/version.c.in @@ -0,0 +1,7 @@ +char version[12] = "${TD_VER_1}.${TD_VER_2}.${TD_VER_3}.${TD_VER_4}"; +char compatible_version[12] = "${TD_VER_COMPATIBLE}"; +char gitinfo[48] = "${TD_VER_GIT}"; +char gitinfoOfInternal[48] = "${TD_VER_GIT_INTERNAL}"; +char buildinfo[64] = "Built at ${TD_VER_DATE}"; + +void libtaos_${TD_VER_1}_${TD_VER_2}_${TD_VER_3}_${TD_VER_4}_${TD_VER_OSTYPE}_${TD_VER_CPUTYPE}_${TD_VER_VERTYPE}() {}; -- GitLab