update Thirdparty, use mysql client lib

This commit is contained in:
jarodruan 2020-02-27 22:07:29 +08:00
parent 42a105648a
commit 5bd0b9a2aa
8 changed files with 385 additions and 520 deletions

View File

@ -66,7 +66,7 @@ IF (UNIX)
ELSEIF (WIN32)
set(PLATFORM "window")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4101 /wd4244 /wd4996 /wd4091 /wd4503 /wd4819 /wd4200 /wd4800 /wd4267 /wd4834")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4101 /wd4244 /wd4996 /wd4091 /wd4503 /wd4819 /wd4200 /wd4800 /wd4267 /wd4834 /wd4267")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj " )
ELSE ()

View File

@ -59,7 +59,6 @@ add_custom_target(thirdparty)
include(ExternalProject)
if (TARS_PROTOBUF)
set(PROTOBUF_DIR_INC "${THIRDPARTY_PATH}/protobuf/include")
set(PROTOBUF_DIR_LIB "${THIRDPARTY_PATH}/protobuf/lib")
@ -70,71 +69,40 @@ if (TARS_PROTOBUF)
set(LIB_PROTOC "libprotoc")
set(LIB_PROTOBUF "libprotobuf")
SET(RUN_PROTOBUF_INSTALL_FILE "${PROJECT_BINARY_DIR}/run-protobuf-install.cmake")
FILE(WRITE ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/protobuf)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/protobuf/include/google)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/protobuf-lib/${CMAKE_BUILD_TYPE}/libprotoc.dll ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/protobuf-lib/${CMAKE_BUILD_TYPE}/libprotoc.lib ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/protobuf-lib/${CMAKE_BUILD_TYPE}/libprotobuf.dll ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/protobuf-lib/${CMAKE_BUILD_TYPE}/libprotobuf.lib ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/protobuf-lib/${CMAKE_BUILD_TYPE}/protoc.exe ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy_directory ${CMAKE_BINARY_DIR}/src/protobuf-lib/src/google ${CMAKE_BINARY_DIR}/src/protobuf/include/google)\n")
ExternalProject_Add(ADD_${LIB_PROTOBUF}
URL http://cdn.tarsyun.com/src/protobuf-cpp-3.11.3.tar.gz
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND cmake cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
CONFIGURE_COMMAND cmake cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/protobuf -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/protobuf-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND cmake --build . --config release
LOG_CONFIGURE 1
LOG_BUILD 1
INSTALL_COMMAND cmake -P ${RUN_PROTOBUF_INSTALL_FILE}
# INSTALL_COMMAND cmake -P ${RUN_PROTOBUF_INSTALL_FILE}
URL_MD5 fb59398329002c98d4d92238324c4187
)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/protobuf/lib/libprotoc.dll DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/protobuf/lib/libprotoc.lib DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/protobuf/lib/libprotobuf.dll DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/protobuf/lib/libprotobuf.lib DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/protobuf/lib/protoc.exe DESTINATION bin)
else ()
set(LIB_PROTOC "protoc")
set(LIB_PROTOBUF "protobuf")
SET(RUN_PROTOBUF_INSTALL_FILE "${PROJECT_BINARY_DIR}/run-protobuf-install.cmake")
FILE(WRITE ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/protobuf)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/protobuf/bin)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/protobuf/include/google)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/protobuf-lib/libprotoc.a ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/protobuf-lib/libprotobuf.a ${CMAKE_BINARY_DIR}/src/protobuf/lib)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/protobuf-lib/protoc ${CMAKE_BINARY_DIR}/src/protobuf/bin)\n")
FILE(APPEND ${RUN_PROTOBUF_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy_directory ${CMAKE_BINARY_DIR}/src/protobuf-lib/src/google ${CMAKE_BINARY_DIR}/src/protobuf/include/google)\n")
ExternalProject_Add(ADD_${LIB_PROTOBUF}
URL http://cdn.tarsyun.com/src/protobuf-cpp-3.11.3.tar.gz
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND cmake cmake -DBUILD_SHARED_LIBS=OFF
CONFIGURE_COMMAND cmake cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/protobuf -DBUILD_SHARED_LIBS=OFF
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/protobuf-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND make
LOG_CONFIGURE 1
LOG_BUILD 1
INSTALL_COMMAND cmake -P ${RUN_PROTOBUF_INSTALL_FILE}
# INSTALL_COMMAND cmake -P ${RUN_PROTOBUF_INSTALL_FILE}
URL_MD5 fb59398329002c98d4d92238324c4187
)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/protobuf/lib/libprotoc.a DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/protobuf/lib/libprotobuf.a DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/protobuf/bin/protoc DESTINATION bin)
endif ()
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/protobuf/lib DESTINATION .)
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/protobuf/include/google DESTINATION include)
add_dependencies(thirdparty ADD_${LIB_PROTOBUF})
@ -153,18 +121,6 @@ if (TARS_SSL)
set(LIB_SSL "libssl")
set(LIB_CRYPTO "libcrypto")
SET(RUN_SSL_INSTALL_FILE "${PROJECT_BINARY_DIR}/run-ssl-install.cmake")
FILE(WRITE ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/openssl)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/openssl/include/openssl)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/openssl-lib/libssl-1_1-x64.dll ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/openssl-lib/libssl.lib ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/openssl-lib/libssl_static.lib ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/openssl-lib/libcrypto-1_1-x64.dll ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/openssl-lib/libcrypto.lib ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/openssl-lib/libcrypto_static.lib ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy_directory ${CMAKE_BINARY_DIR}/src/openssl-lib/include/openssl ${CMAKE_BINARY_DIR}/src/openssl/include/openssl)\n")
ExternalProject_Add(ADD_${LIB_SSL}
DEPENDS ${LIB_ZLIB}
URL http://cdn.tarsyun.com/src/openssl-1.1.1d.tar.gz
@ -176,29 +132,13 @@ if (TARS_SSL)
BUILD_COMMAND nmake
LOG_CONFIGURE 1
LOG_BUILD 1
INSTALL_COMMAND cmake -P ${RUN_SSL_INSTALL_FILE}
INSTALL_COMMAND nmake install
URL_MD5 3be209000dbc7e1b95bcdf47980a3baa
)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/openssl/lib/libssl-1_1-x64.dll DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/openssl/lib/libssl.lib DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/openssl/lib/libssl_static.lib DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/openssl/lib/libcrypto-1_1-x64.dll DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/openssl/lib/libcrypto.lib DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/openssl/lib/libcrypto_static.lib DESTINATION lib)
else ()
set(LIB_SSL "ssl")
set(LIB_CRYPTO "crypto")
SET(RUN_SSL_INSTALL_FILE "${PROJECT_BINARY_DIR}/run-ssl-install.cmake")
FILE(WRITE ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/openssl)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/openssl/include/openssl)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/openssl-lib/libssl.a ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/openssl-lib/libcrypto.a ${CMAKE_BINARY_DIR}/src/openssl/lib)\n")
FILE(APPEND ${RUN_SSL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy_directory ${CMAKE_BINARY_DIR}/src/openssl-lib/include/openssl ${CMAKE_BINARY_DIR}/src/openssl/include/openssl)\n")
ExternalProject_Add(ADD_${LIB_SSL}
DEPENDS ${LIB_ZLIB}
URL http://cdn.tarsyun.com/src/openssl-1.1.1d.tar.gz
@ -210,15 +150,13 @@ if (TARS_SSL)
BUILD_COMMAND make
LOG_CONFIGURE 1
LOG_BUILD 1
INSTALL_COMMAND cmake -P ${RUN_SSL_INSTALL_FILE}
# INSTALL_COMMAND cmake -P ${RUN_SSL_INSTALL_FILE}
URL_MD5 3be209000dbc7e1b95bcdf47980a3baa
)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/openssl/lib/libssl.a DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/openssl/lib/libcrypto.a DESTINATION lib)
endif ()
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/openssl/lib DESTINATION .)
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/openssl/include/openssl DESTINATION include)
add_dependencies(thirdparty ADD_${LIB_SSL})
@ -232,169 +170,94 @@ if (TARS_MYSQL)
if (WIN32)
set(LIB_MYSQL "libmysql")
SET(RUN_MYSQL_INSTALL_FILE "${PROJECT_BINARY_DIR}/run-mysql-install.cmake")
FILE(WRITE ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/mysql)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/mysql/lib)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/mysql/include/mysql)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/mysql-lib/libmysql/${CMAKE_BUILD_TYPE}/libmysql.lib ${CMAKE_BINARY_DIR}/src/mysql/lib)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/mysql-lib/libmysql/${CMAKE_BUILD_TYPE}/libmysql.dll ${CMAKE_BINARY_DIR}/src/mysql/lib)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy_directory ${CMAKE_BINARY_DIR}/src/mysql-lib/include ${CMAKE_BINARY_DIR}/src/mysql/include/mysql)\n")
if(TARS_SSL)
ExternalProject_Add(ADD_${LIB_MYSQL}
URL http://cdn.tarsyun.com/src/mysql-5.6.46.zip
DEPENDS ADD_${LIB_SSL}
URL http://cdn.tarsyun.com/src/mysql-connector-c-6.1.11-src.zip
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND cmake . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/mysql -DBUILD_CONFIG=mysql_release -DWITH_SSL=${SSL_DIR}
CONFIGURE_COMMAND cmake . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/mysql -DBUILD_CONFIG=mysql_release
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/mysql-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND cmake --build . --config ${CMAKE_BUILD_TYPE} --target libmysql
BUILD_COMMAND cmake --build . --config release
LOG_CONFIGURE 1
LOG_BUILD 1
INSTALL_COMMAND cmake -P ${RUN_MYSQL_INSTALL_FILE}
URL_MD5 851be8973981979041ad422f7e5f693a
INSTALL_COMMAND cmake --build . --config release --target install
URL_MD5 62de01beffc48348708c983a585b4dc1
)
else()
ExternalProject_Add(ADD_${LIB_MYSQL}
URL http://cdn.tarsyun.com/src/mysql-5.6.46.zip
DEPENDS ADD_${LIB_SSL}
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND cmake . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/mysql -DBUILD_CONFIG=mysql_release
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/mysql-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND cmake --build . --config ${CMAKE_BUILD_TYPE} --target libmysql
LOG_CONFIGURE 1
LOG_BUILD 1
INSTALL_COMMAND cmake -P ${RUN_MYSQL_INSTALL_FILE}
URL_MD5 851be8973981979041ad422f7e5f693a
)
endif()
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/mysql/lib/libmysql.lib DESTINATION lib)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/mysql/lib/libmysql.dll DESTINATION lib)
else ()
set(LIB_MYSQL "mysqlclient")
SET(RUN_MYSQL_INSTALL_FILE "${PROJECT_BINARY_DIR}/run-mysql-install.cmake")
FILE(WRITE ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/mysql)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/mysql/lib)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/mysql/include/mysql)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/mysql-lib/libmysql/libmysqlclient.a ${CMAKE_BINARY_DIR}/src/mysql/lib)\n")
FILE(APPEND ${RUN_MYSQL_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy_directory ${CMAKE_BINARY_DIR}/src/mysql-lib/include ${CMAKE_BINARY_DIR}/src/mysql/include/mysql)\n")
if(TARS_SSL)
ExternalProject_Add(ADD_${LIB_MYSQL}
URL http://cdn.tarsyun.com/src/mysql-5.6.46.tar.gz
DEPENDS ADD_${LIB_SSL}
URL http://cdn.tarsyun.com/src/mysql-connector-c-6.1.11-src.tar.gz
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND cmake . -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDISABLE_SHARED=1 -DWITH_SSL=${SSL_DIR}
CONFIGURE_COMMAND cmake . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDISABLE_SHARED=1
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/mysql-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND make mysqlclient
LOG_CONFIGURE 1
LOG_BUILD 1
INSTALL_COMMAND cmake -P ${RUN_MYSQL_INSTALL_FILE}
# URL_MD5 c537c08c1276abc79d76e8e562bbcea5
URL_MD5 9d225528742c882d5b1e4a40b0877690
# INSTALL_COMMAND cmake --build . --config release --target install
URL_MD5 98ca2071f9d4c6b73146cc0455f6b914
)
else()
ExternalProject_Add(ADD_${LIB_MYSQL}
URL http://cdn.tarsyun.com/src/mysql-5.6.46.tar.gz
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND cmake . -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDISABLE_SHARED=1
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/mysql-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND make mysqlclient
LOG_CONFIGURE 1
LOG_BUILD 1
INSTALL_COMMAND cmake -P ${RUN_MYSQL_INSTALL_FILE}
# URL_MD5 c537c08c1276abc79d76e8e562bbcea5
URL_MD5 9d225528742c882d5b1e4a40b0877690
)
endif()
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/mysql/lib/libmysqlclient.a DESTINATION lib)
endif ()
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/mysql/lib DESTINATION .)
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/mysql/include/mysql/
DESTINATION include/mysql
PATTERN "*.h")
# INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/mysql/include/mysql DESTINATION include)
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/mysql/include/mysql DESTINATION include)
add_dependencies(thirdparty ADD_${LIB_MYSQL})
endif ()
if (TARS_HTTP2)
set(NGHTTP2_DIR_INC "${THIRDPARTY_PATH}/nghttp2/include/")
set(NGHTTP2_DIR_LIB "${THIRDPARTY_PATH}/nghttp2/lib")
include_directories(${NGHTTP2_DIR_INC})
link_directories(${NGHTTP2_DIR_LIB})
set(LIB_HTTP2 "nghttp2_static")
if (WIN32)
set(LIB_HTTP2 "nghttp2_static")
SET(RUN_HTTP2_INSTALL_FILE "${PROJECT_BINARY_DIR}/run-http2-install.cmake")
FILE(WRITE ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/nghttp2)\n")
FILE(APPEND ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/nghttp2/lib)\n")
FILE(APPEND ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/nghttp2/include/nghttp2)\n")
FILE(APPEND ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/nghttp2-lib/lib/${CMAKE_BUILD_TYPE}/nghttp2_static.lib ${CMAKE_BINARY_DIR}/src/nghttp2/lib)\n")
FILE(APPEND ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy_directory ${CMAKE_BINARY_DIR}/src/nghttp2-lib/lib/includes/nghttp2 ${CMAKE_BINARY_DIR}/src/nghttp2/include/nghttp2)\n")
ExternalProject_Add(ADD_${LIB_HTTP2}
URL http://cdn.tarsyun.com/src/nghttp2-1.40.0.tar.gz
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND cmake . -DENABLE_SHARED_LIB=OFF -DENABLE_STATIC_LIB=ON -DENABLE_LIB_ONLY=ON
CONFIGURE_COMMAND cmake . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/nghttp2 -DENABLE_LIB_ONLY=ON
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/nghttp2-lib
BUILD_IN_SOURCE 1
LOG_BUILD 1
LOG_CONFIGURE 1
BUILD_COMMAND cmake --build . --config release
INSTALL_COMMAND cmake -P ${RUN_HTTP2_INSTALL_FILE}
INSTALL_COMMAND cmake --build . --config release --target install
URL_MD5 5df375bbd532fcaa7cd4044b54b1188d
)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/nghttp2/lib/nghttp2_static.lib DESTINATION lib)
else ()
set(LIB_HTTP2 "nghttp2_static")
SET(RUN_HTTP2_INSTALL_FILE "${PROJECT_BINARY_DIR}/run-http2-install.cmake")
FILE(WRITE ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/nghttp2)\n")
FILE(APPEND ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/nghttp2/lib)\n")
FILE(APPEND ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/src/nghttp2/include/nghttp2)\n")
FILE(APPEND ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CMAKE_BINARY_DIR}/src/nghttp2-lib/lib/libnghttp2_static.a ${CMAKE_BINARY_DIR}/src/nghttp2/lib)\n")
FILE(APPEND ${RUN_HTTP2_INSTALL_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy_directory ${CMAKE_BINARY_DIR}/src/nghttp2-lib/lib/includes/nghttp2 ${CMAKE_BINARY_DIR}/src/nghttp2/include/nghttp2)\n")
ExternalProject_Add(ADD_${LIB_HTTP2}
URL http://cdn.tarsyun.com/src/nghttp2-1.40.0.tar.gz
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND cmake . -DENABLE_SHARED_LIB=OFF -DENABLE_STATIC_LIB=ON -DENABLE_LIB_ONLY=ON
CONFIGURE_COMMAND cmake . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/nghttp2 -DENABLE_LIB_ONLY=ON
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/nghttp2-lib
BUILD_IN_SOURCE 1
LOG_BUILD 1
LOG_CONFIGURE 1
BUILD_COMMAND make
INSTALL_COMMAND cmake -P ${RUN_HTTP2_INSTALL_FILE}
# INSTALL_COMMAND incmake --build . --config release --target install
URL_MD5 5df375bbd532fcaa7cd4044b54b1188d
)
INSTALL(FILES ${CMAKE_BINARY_DIR}/src/nghttp2/lib/libnghttp2_static.a DESTINATION lib)
endif ()
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/nghttp2/lib DESTINATION .)
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/nghttp2/include/nghttp2 DESTINATION include)
add_dependencies(thirdparty ADD_${LIB_HTTP2})
endif ()
endif ()
message("----------------------------------------------------")
message("TARS_MYSQL: ${TARS_MYSQL}")

View File

@ -417,7 +417,9 @@ void TarsCurrent::reportToStat(const string& sObj)
// int sptime = endtime - _begintime;
//被调上报自己的set信息set信息在setReportInfo设置
stat->report(sObj, "" , _request.sServantName, _data->ip(), 0, _request.sFuncName, (StatReport::StatResult)_ret, TNOWMS - _data->recvTimeStamp(), 0);
// stat->report(sObj, "" , _request.sServantName, _data->ip(), 0, _request.sFuncName, (StatReport::StatResult)_ret, TNOWMS - _data->recvTimeStamp(), 0);
stat->report(sObj, "", _request.sFuncName, _data->ip(), 0, (StatReport::StatResult)_ret, TNOWMS - _data->recvTimeStamp(), 0, false);
}
}

View File

@ -9,7 +9,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 37
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@ -47,6 +47,7 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@ -54,6 +55,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@ -84,8 +86,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@ -176,7 +176,7 @@ extern FILE *yyin, *yyout;
*/
#define YY_LESS_LINENO(n) \
do { \
int yyl;\
yy_size_t yyl;\
for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
@ -369,7 +369,7 @@ static void yy_fatal_error (yyconst char msg[] );
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
yyleng = (size_t) (yy_cp - yy_bp); \
yyleng = (yy_size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@ -513,7 +513,7 @@ int yy_flex_debug = 0;
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 1 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
/**
* Tencent is pleased to support the open source community by making Tars available.
*
@ -529,7 +529,7 @@ char *yytext;
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
#line 20 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 20 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
#include <map>
#include <string>
#include <sstream>
@ -649,7 +649,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#define ECHO fwrite( yytext, yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@ -660,7 +660,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@ -742,7 +742,7 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
#line 67 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 67 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
#line 749 "tars.lex.cpp"
@ -840,12 +840,12 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
#line 69 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 69 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{ BEGIN(INCL); }
YY_BREAK
case 2:
YY_RULE_SETUP
#line 71 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 71 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
if ( include_file_stack_ptr >= MAX_INCLUDE_DEPTH )
{
@ -878,7 +878,7 @@ YY_RULE_SETUP
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(INCL):
#line 101 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 101 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
--include_file_stack_ptr;
if ( include_file_stack_ptr < 0 )
@ -897,14 +897,14 @@ case YY_STATE_EOF(INCL):
YY_BREAK
case 3:
YY_RULE_SETUP
#line 117 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 117 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
return TARS_SCOPE_DELIMITER;
}
YY_BREAK
case 4:
YY_RULE_SETUP
#line 121 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 121 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
// C++ comment
bool e = false;
@ -925,7 +925,7 @@ YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
#line 139 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 139 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
// C comment
bool e = false;
@ -976,7 +976,7 @@ YY_RULE_SETUP
YY_BREAK
case 6:
YY_RULE_SETUP
#line 187 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 187 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
StringGrammarPtr ident = new StringGrammar;
ident->v = yytext;
@ -987,7 +987,7 @@ YY_RULE_SETUP
case 7:
/* rule 7 can match eol */
YY_RULE_SETUP
#line 194 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 194 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
StringGrammarPtr ident = new StringGrammar;
ident->v = yytext;
@ -1000,7 +1000,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
#line 204 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 204 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
StringGrammarPtr str = new StringGrammar;
bool e = false;
@ -1115,7 +1115,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
#line 316 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 316 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
errno = 0;
IntergerGrammarPtr ptr = new IntergerGrammar;
@ -1140,7 +1140,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
#line 338 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 338 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
errno = 0;
FloatGrammarPtr ptr = new FloatGrammar;
@ -1175,7 +1175,7 @@ YY_RULE_SETUP
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
#line 369 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 369 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
if(yytext[0] == '\n')
{
@ -1185,7 +1185,7 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
#line 376 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 376 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
{
if(yytext[0] < 32 || yytext[0] > 126)
{
@ -1204,7 +1204,7 @@ YY_RULE_SETUP
YY_BREAK
case 13:
YY_RULE_SETUP
#line 392 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 392 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
ECHO;
YY_BREAK
#line 1211 "tars.lex.cpp"
@ -1398,7 +1398,7 @@ static int yy_get_next_buffer (void)
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
@ -1531,7 +1531,7 @@ static int yy_get_next_buffer (void)
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 51);
return yy_is_jam ? 0 : yy_current_state;
return yy_is_jam ? 0 : yy_current_state;
}
static void yyunput (int c, register char * yy_bp )
@ -1623,7 +1623,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( yywrap( ) )
return EOF;
return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
@ -1764,6 +1764,10 @@ static void yy_load_buffer_state (void)
yyfree((void *) b );
}
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a yyrestart() or at EOF.
@ -1968,8 +1972,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
@ -1977,8 +1981,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
yy_size_t i;
yy_size_t n, i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@ -2211,7 +2214,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
#line 392 "/home/tars/TarsFramework-2.0/tarscpp/tools/tarsgrammar/tars.l"
#line 392 "/Users/jarod/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.0.4. */
/* A Bison parser, made by GNU Bison 3.2.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -30,6 +30,9 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Undocumented macros, especially those whose name start with YY_,
are private implementation details. Do not rely on them. */
#ifndef YY_YY_TARS_TAB_HPP_INCLUDED
# define YY_YY_TARS_TAB_HPP_INCLUDED
/* Debug traces. */

View File

@ -18,7 +18,7 @@
#define __TC_MYSQL_H
#include "util/tc_platform.h"
#include "mysql/mysql.h"
#include "mysql.h"
#include "util/tc_ex.h"
#include <map>
#include <vector>

View File

@ -17,7 +17,7 @@
#if TARS_MYSQL
#include "util/tc_mysql.h"
#include "util/tc_common.h"
#include "mysql/errmsg.h"
#include "errmsg.h"
#include <sstream>
#include <string.h>