feat(taosAdapter): taosAdapter supports Windows (#16229)
This commit is contained in:
parent
50e1212b92
commit
cd6c9def67
|
@ -2,7 +2,7 @@
|
||||||
# taosadapter
|
# taosadapter
|
||||||
ExternalProject_Add(taosadapter
|
ExternalProject_Add(taosadapter
|
||||||
GIT_REPOSITORY https://github.com/taosdata/taosadapter.git
|
GIT_REPOSITORY https://github.com/taosdata/taosadapter.git
|
||||||
GIT_TAG 3d21433
|
GIT_TAG abed566
|
||||||
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter"
|
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter"
|
||||||
BINARY_DIR ""
|
BINARY_DIR ""
|
||||||
#BUILD_IN_SOURCE TRUE
|
#BUILD_IN_SOURCE TRUE
|
||||||
|
|
|
@ -28,6 +28,13 @@ if not exist %tagert_dir%\\driver (
|
||||||
if not exist C:\\TDengine\\cfg\\taos.cfg (
|
if not exist C:\\TDengine\\cfg\\taos.cfg (
|
||||||
copy %source_dir%\\packaging\\cfg\\taos.cfg %tagert_dir%\\cfg\\taos.cfg > nul
|
copy %source_dir%\\packaging\\cfg\\taos.cfg %tagert_dir%\\cfg\\taos.cfg > nul
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if exist %binary_dir%\\test\\cfg\\taosadapter.toml (
|
||||||
|
if not exist %tagert_dir%\\cfg\\taosadapter.toml (
|
||||||
|
copy %binary_dir%\\test\\cfg\\taosadapter.toml %tagert_dir%\\cfg\\taosadapter.toml > nul
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
copy %source_dir%\\include\\client\\taos.h %tagert_dir%\\include > nul
|
copy %source_dir%\\include\\client\\taos.h %tagert_dir%\\include > nul
|
||||||
copy %source_dir%\\include\\util\\taoserror.h %tagert_dir%\\include > nul
|
copy %source_dir%\\include\\util\\taoserror.h %tagert_dir%\\include > nul
|
||||||
copy %source_dir%\\include\\libs\\function\\taosudf.h %tagert_dir%\\include > nul
|
copy %source_dir%\\include\\libs\\function\\taosudf.h %tagert_dir%\\include > nul
|
||||||
|
@ -40,6 +47,9 @@ copy %binary_dir%\\build\\bin\\udfd.exe %tagert_dir% > nul
|
||||||
if exist %binary_dir%\\build\\bin\\taosBenchmark.exe (
|
if exist %binary_dir%\\build\\bin\\taosBenchmark.exe (
|
||||||
copy %binary_dir%\\build\\bin\\taosBenchmark.exe %tagert_dir% > nul
|
copy %binary_dir%\\build\\bin\\taosBenchmark.exe %tagert_dir% > nul
|
||||||
)
|
)
|
||||||
|
if exist %binary_dir%\\build\\bin\\taosadapter.exe (
|
||||||
|
copy %binary_dir%\\build\\bin\\taosadapter.exe %tagert_dir% > nul
|
||||||
|
)
|
||||||
|
|
||||||
mshta vbscript:createobject("shell.application").shellexecute("%~s0",":hasAdmin","","runas",1)(window.close)&& echo To start/stop TDengine with administrator privileges: sc start/stop taosd &goto :eof
|
mshta vbscript:createobject("shell.application").shellexecute("%~s0",":hasAdmin","","runas",1)(window.close)&& echo To start/stop TDengine with administrator privileges: sc start/stop taosd &goto :eof
|
||||||
:hasAdmin
|
:hasAdmin
|
||||||
|
|
|
@ -128,6 +128,7 @@ ELSE ()
|
||||||
COMMAND cmake -E copy ./taosadapter.service ${CMAKE_BINARY_DIR}/test/cfg/
|
COMMAND cmake -E copy ./taosadapter.service ${CMAKE_BINARY_DIR}/test/cfg/
|
||||||
COMMAND cmake -E copy taosadapter-debug ${CMAKE_BINARY_DIR}/build/bin
|
COMMAND cmake -E copy taosadapter-debug ${CMAKE_BINARY_DIR}/build/bin
|
||||||
)
|
)
|
||||||
|
unset(_upx_prefix)
|
||||||
ELSEIF (TD_DARWIN)
|
ELSEIF (TD_DARWIN)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(taosadapter
|
ExternalProject_Add(taosadapter
|
||||||
|
@ -149,8 +150,42 @@ ELSE ()
|
||||||
COMMAND cmake -E copy ./taosadapter.service ${CMAKE_BINARY_DIR}/test/cfg/
|
COMMAND cmake -E copy ./taosadapter.service ${CMAKE_BINARY_DIR}/test/cfg/
|
||||||
COMMAND cmake -E copy taosadapter-debug ${CMAKE_BINARY_DIR}/build/bin
|
COMMAND cmake -E copy taosadapter-debug ${CMAKE_BINARY_DIR}/build/bin
|
||||||
)
|
)
|
||||||
|
# unset(_upx_prefix)
|
||||||
|
ELSEIF (TD_WINDOWS)
|
||||||
|
include(ExternalProject)
|
||||||
|
set(_upx_prefix "${CMAKE_BINARY_DIR}/.taos/externals/upx")
|
||||||
|
ExternalProject_Add(upx
|
||||||
|
PREFIX "${_upx_prefix}"
|
||||||
|
URL https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win32.zip
|
||||||
|
CONFIGURE_COMMAND cmake -E true
|
||||||
|
BUILD_COMMAND cmake -E true
|
||||||
|
INSTALL_COMMAND cmake -E true
|
||||||
|
)
|
||||||
|
|
||||||
|
ExternalProject_Add(taosadapter
|
||||||
|
PREFIX "taosadapter"
|
||||||
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosadapter
|
||||||
|
BUILD_ALWAYS off
|
||||||
|
DEPENDS taos
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
CONFIGURE_COMMAND cmake -E echo "taosadapter no need cmake to config"
|
||||||
|
PATCH_COMMAND
|
||||||
|
COMMAND git clean -f -d
|
||||||
|
BUILD_COMMAND
|
||||||
|
COMMAND set CGO_CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}/../include/client
|
||||||
|
COMMAND set CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/build/lib
|
||||||
|
COMMAND go build -ldflags "-s -w -X github.com/taosdata/taosadapter/version.Version=${taos_version} -X github.com/taosdata/taosadapter/version.CommitID=${taosadapter_commit_sha1}"
|
||||||
|
COMMAND go build -o taosadapter-debug -ldflags "-X github.com/taosdata/taosadapter/version.Version=${taos_version} -X github.com/taosdata/taosadapter/version.CommitID=${taosadapter_commit_sha1}"
|
||||||
|
INSTALL_COMMAND
|
||||||
|
COMMAND ${_upx_prefix}/src/upx/upx taosadapter.exe
|
||||||
|
COMMAND cmake -E copy taosadapter.exe ${CMAKE_BINARY_DIR}/build/bin
|
||||||
|
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test/cfg/
|
||||||
|
COMMAND cmake -E copy ./example/config/taosadapter.toml ${CMAKE_BINARY_DIR}/test/cfg/
|
||||||
|
COMMAND cmake -E copy ./taosadapter.service ${CMAKE_BINARY_DIR}/test/cfg/
|
||||||
|
COMMAND cmake -E copy taosadapter-debug ${CMAKE_BINARY_DIR}/build/bin
|
||||||
|
)
|
||||||
unset(_upx_prefix)
|
unset(_upx_prefix)
|
||||||
ELSE ()
|
ELSE ()
|
||||||
MESSAGE("${Yellow} Windows system still use original embedded httpd ${ColourReset}")
|
MESSAGE("${Yellow} taosAdapter Not supported yet ${ColourReset}")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
Loading…
Reference in New Issue