Skip to content

Commit

Permalink
tars-tools.cmake support dynamic of ssl https mysql in mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanshudong committed Oct 25, 2024
1 parent d40a3b8 commit 40c6293
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 96 deletions.
76 changes: 10 additions & 66 deletions cmake/Thirdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ endif(UNIX)
option(TARS_SSL "option for ssl" OFF)
option(TARS_HTTP2 "option for http2" OFF)
option(TARS_PROTOBUF "option for protocol" OFF)
#option(TARS_GPERF "option for gperf" OFF)

#IF(UNIX)
# FIND_PACKAGE(ZLIB)
# IF(NOT ZLIB_FOUND)
# SET(ERRORMSG "zlib library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake.")
# IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# SET(ERRORMSG ${ERRORMSG} "On Debian/Ubuntu, package name is zlib1g-dev(apt-get install zlib1g-dev), on Redhat/Centos and derivates it is zlib-devel (yum install zlib-devel).")
# ENDIF()
# MESSAGE(FATAL_ERROR ${ERRORMSG})
# ENDIF()
#
#ENDIF(UNIX)

if (TARS_MYSQL)
add_definitions(-DTARS_MYSQL=1)
Expand All @@ -30,10 +17,6 @@ if (TARS_GZIP)
add_definitions(-DTARS_GZIP=1)
endif ()

#if (TARS_GPERF)
# add_definitions(-DTARS_GPERF=1)
#endif ()

if (TARS_SSL)
add_definitions(-DTARS_SSL=1)
endif ()
Expand All @@ -57,51 +40,12 @@ set(LIB_SSL)
set(LIB_CRYPTO)
set(LIB_PROTOBUF)
set(LIB_GTEST)
#set(LIB_GPERF)
#set(LIB_TCMALLOC_PROFILER)
#set(LIB_TCMALLOC_MINIMAL)

#-------------------------------------------------------------

add_custom_target(thirdparty)

include(ExternalProject)
#
#if (TARS_GPERF)
#
# set(GPERF_DIR_INC "${THIRDPARTY_PATH}/gperf/include")
# set(GRPEF_DIR_LIB "${THIRDPARTY_PATH}/gperf/lib")
# include_directories(${GPERF_DIR_INC})
# link_directories(${GRPEF_DIR_LIB})
#
# if (UNIX)
# set(LIB_GPERF "profiler")
# set(LIB_TCMALLOC_PROFILER "tcmalloc_and_profiler")
# set(LIB_TCMALLOC_MINIMAL "tcmalloc_and_minimal")
#
# ExternalProject_Add(ADD_${LIB_GPERF}
# URL https://tars-thirdpart-1300910346.cos.ap-guangzhou.myqcloud.com//src/gperftools-2.7.tar.gz
# DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/download
# PREFIX ${CMAKE_BINARY_DIR}
# INSTALL_DIR ${CMAKE_SOURCE_DIR}
# CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/src/gperf --disable-shared --disable-debugalloc
# SOURCE_DIR ${CMAKE_BINARY_DIR}/src/gperf-lib
# BUILD_IN_SOURCE 1
# BUILD_COMMAND make
# URL_MD5 c6a852a817e9160c79bdb2d3101b4601
# )
#
# add_dependencies(thirdparty ADD_${LIB_GPERF})
#
# INSTALL(FILES ${CMAKE_BINARY_DIR}/src/gperf/bin/pprof
# PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ
# DESTINATION thirdparty/bin/)
# INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/gperf/lib DESTINATION thirdparty)
# INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/gperf/include/gperftools DESTINATION thirdparty/include)
#
# endif (UNIX)
#
#endif (TARS_GPERF)


if(WIN32)

Expand Down Expand Up @@ -138,7 +82,7 @@ if (WIN32)
CONFIGURE_COMMAND ${CMAKE_COMMAND} . -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/gtest -A x64 -Dgtest_force_shared_crt=on -DBUILD_GMOCK=OFF
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/gtest-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} -- j4
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target install
URL_MD5 82358affdd7ab94854c8ee73a180fc53
)
Expand Down Expand Up @@ -182,7 +126,7 @@ if (TARS_PROTOBUF)
CONFIGURE_COMMAND ${CMAKE_COMMAND} 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_COMMAND} --build . --config release
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config release -- j4
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config release --target install
URL_MD5 fb59398329002c98d4d92238324c4187
)
Expand All @@ -195,7 +139,7 @@ if (TARS_PROTOBUF)
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/download
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND ${CMAKE_COMMAND} cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/protobuf -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
CONFIGURE_COMMAND ${CMAKE_COMMAND} cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/protobuf -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/protobuf-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND make
Expand Down Expand Up @@ -243,7 +187,7 @@ if (TARS_SSL)
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/download
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND ./config --prefix=${CMAKE_BINARY_DIR}/src/openssl --openssldir=ssl no-shared
CONFIGURE_COMMAND ./config --prefix=${CMAKE_BINARY_DIR}/src/openssl --openssldir=ssl
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/openssl-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND make
Expand Down Expand Up @@ -275,7 +219,7 @@ if (TARS_MYSQL)
CONFIGURE_COMMAND ${CMAKE_COMMAND} . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/mysql -DBUILD_CONFIG=mysql_release -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/mysql-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config release
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config release -- j4
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config release --target install
URL_MD5 bad636fe9bcc9bb62e3f5b784495a9b5
)
Expand All @@ -288,7 +232,7 @@ if (TARS_MYSQL)
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/download
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND ${CMAKE_COMMAND} . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/mysql -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DDISABLE_SHARED=1 -DSTACK_DIRECTION=1 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
CONFIGURE_COMMAND ${CMAKE_COMMAND} . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/mysql -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DSTACK_DIRECTION=1 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/mysql-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND make mysqlclient
Expand Down Expand Up @@ -321,7 +265,7 @@ if (TARS_GZIP)
CONFIGURE_COMMAND ${CMAKE_COMMAND} . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/zlib
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/zlib-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config release
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config release -- j4
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config release --target install
URL_MD5 1c9f62f0778697a09d36121ead88e08e
)
Expand Down Expand Up @@ -366,10 +310,10 @@ if (TARS_HTTP2)
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/download
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_SOURCE_DIR}
CONFIGURE_COMMAND ${CMAKE_COMMAND} . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/nghttp2 -DENABLE_LIB_ONLY=ON -DENABLE_STATIC_LIB=ON
CONFIGURE_COMMAND ${CMAKE_COMMAND} . -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/src/nghttp2 -DENABLE_LIB_ONLY=ON
SOURCE_DIR ${CMAKE_BINARY_DIR}/src/nghttp2-lib
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config release
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config release -- j4
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config release --target install
URL_MD5 5df375bbd532fcaa7cd4044b54b1188d
)
Expand Down
103 changes: 73 additions & 30 deletions servant/makefile/tars-tools.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,67 @@ set(TARS_PATH "@CMAKE_INSTALL_PREFIX@")
option(TARS_MYSQL "open mysql support" @TARS_MYSQL@)
option(TARS_SSL "open ssl support" @TARS_SSL@)
option(TARS_HTTP2 "open http2 support" @TARS_HTTP2@)
option(ENABLE_SHARED "enable tars shared lib" OFF)

set(TARS_INC "${TARS_PATH}/include")
set(TARS_LIB_DIR "${TARS_PATH}/lib" )
set(THRIDPARTY_LIB_DIR "${TARS_PATH}/thirdparty/lib" )

# set tars2cpp flag: list(APPEND TARS_TOOL_FLAG "--with-tars")
list(APPEND TARS_TOOL_FLAG "")

if(WIN32)
set (LIB_TARS_SERVANT "${TARS_LIB_DIR}/tarsservant.lib")
set (LIB_TARS_UTIL "${TARS_LIB_DIR}/tarsutil.lib")
else()
set (LIB_TARS_SERVANT "${TARS_LIB_DIR}/libtarsservant.a")
set (LIB_TARS_UTIL "${TARS_LIB_DIR}/libtarsutil.a")
endif()

include_directories(${TARS_INC})
link_directories(${TARS_LIB_DIR})
include_directories(${TARS_PATH}/thirdparty/include/mysql)

if(WIN32)
set(LIB_SSL "libssl")
set(LIB_CRYPTO "libcrypto")
set(LIB_MYSQL "libmysql")
set(LIB_HTTP2 "nghttp2_static")

if(ENABLE_SHARED)
if(WIN32)
set (LIB_TARS_SERVANT "${TARS_LIB_DIR}/tarsservant_shared.lib")
set (LIB_TARS_UTIL "${TARS_LIB_DIR}/tarsutil_shared.lib")
elseif(APPLE)
set (LIB_TARS_SERVANT "${TARS_LIB_DIR}/libtarsservant_shared.dylib")
set (LIB_TARS_UTIL "${TARS_LIB_DIR}/libtarsutil_shared.dylib")
else()
set (LIB_TARS_SERVANT "${TARS_LIB_DIR}/libtarsservant_shared.so")
set (LIB_TARS_UTIL "${TARS_LIB_DIR}/libtarsutil_shared.so")
endif()
else()
set(LIB_SSL "ssl")
set(LIB_CRYPTO "crypto")
set(LIB_MYSQL "mysqlclient")
set(LIB_HTTP2 "nghttp2_static")
endif ()
if(WIN32)
set (LIB_TARS_SERVANT "${TARS_LIB_DIR}/tarsservant.lib")
set (LIB_TARS_UTIL "${TARS_LIB_DIR}/tarsutil.lib")
else()
set (LIB_TARS_SERVANT "${TARS_LIB_DIR}/libtarsservant.a")
set (LIB_TARS_UTIL "${TARS_LIB_DIR}/libtarsutil.a")
endif()
endif()

if(ENABLE_SHARED)
if(WIN32)
set(LIB_SSL "libssl")
set(LIB_CRYPTO "libcrypto")
set(LIB_MYSQL "libmysql")
set(LIB_HTTP2 "nghttp2")
else()
set(LIB_SSL "ssl")
set(LIB_CRYPTO "crypto")
set(LIB_MYSQL "mysqlclient")
set(LIB_HTTP2 "nghttp2")
endif ()
else()
if(WIN32)
set(LIB_SSL "libssl")
set(LIB_CRYPTO "libcrypto")
set(LIB_MYSQL "libmysql")
set(LIB_HTTP2 "nghttp2_static")
else()
set(LIB_SSL "${THRIDPARTY_LIB_DIR}/libssl.a")
set(LIB_CRYPTO "${THRIDPARTY_LIB_DIR}/libcrypto.a")
set(LIB_MYSQL "${THRIDPARTY_LIB_DIR}/libmysqlclient.a")
set(LIB_HTTP2 "${THRIDPARTY_LIB_DIR}/libnghttp2_static.a")
endif ()
endif()


set(CMAKE_BUILD_TYPE "Release" CACHE STRING "set build type to release default")
IF (CMAKE_BUILD_TYPE STREQUAL "")
Expand Down Expand Up @@ -98,16 +129,16 @@ ENDIF (UNIX)

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")

set(TARS_RELEASE "${PROJECT_BINARY_DIR}/run-release.cmake")
set(TARS_RELEASE "${PROJECT_BINARY_DIR}/cmake-run/run-release.cmake")
FILE(WRITE ${TARS_RELEASE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo release all)\n")

set(TARS_TAR "${PROJECT_BINARY_DIR}/run-tar.cmake")
set(TARS_TAR "${PROJECT_BINARY_DIR}/cmake-run/run-tar.cmake")
FILE(WRITE ${TARS_TAR} "")

####################################################################

set(TARS_UPLOAD "${PROJECT_BINARY_DIR}/run-upload.cmake")
set(TARS_UPLOAD_TARS "${PROJECT_BINARY_DIR}/run-upload-tars.cmake")
set(TARS_UPLOAD "${PROJECT_BINARY_DIR}/cmake-run/run-upload.cmake")
set(TARS_UPLOAD_TARS "${PROJECT_BINARY_DIR}/cmake-run/run-upload-tars.cmake")

FILE(WRITE ${TARS_UPLOAD} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo upload all)\n")
FILE(WRITE ${TARS_UPLOAD_TARS} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo upload tars all)\n")
Expand All @@ -126,8 +157,8 @@ IF (TARS_K8S_BASE_IMAGE STREQUAL "")
set(TARS_K8S_BASE_IMAGE "tarscloud/tars.cppbase")
ENDIF ()

set(TARS_K8S_UPLOAD "${CMAKE_BINARY_DIR}/run-k8s-upload.cmake")
set(TARS_K8S_UPLOAD_TARS "${CMAKE_BINARY_DIR}/run-k8s-upload-tars.cmake")
set(TARS_K8S_UPLOAD "${CMAKE_BINARY_DIR}/cmake-run/run-k8s-upload.cmake")
set(TARS_K8S_UPLOAD_TARS "${CMAKE_BINARY_DIR}/cmake-run/run-k8s-upload-tars.cmake")
FILE(WRITE ${TARS_K8S_UPLOAD} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo upload k8s all)\n")
FILE(WRITE ${TARS_K8S_UPLOAD_TARS} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo upload k8s tars all)\n")

Expand Down Expand Up @@ -183,7 +214,7 @@ macro(gen_lib APP TARGET)
endif()

#make release #########################################################################
SET(RUN_RELEASE_COMMAND_FILE "${PROJECT_BINARY_DIR}/run-release-${TARGET}.cmake")
SET(RUN_RELEASE_COMMAND_FILE "${PROJECT_BINARY_DIR}/cmake-run/run-release-${TARGET}.cmake")

if (TARS_INPUT)
if(WIN32)
Expand Down Expand Up @@ -273,7 +304,7 @@ macro(gen_server APP TARGET)

#make tar #########################################################################
#must create tmp directory, avoid linux cmake conflict!
SET(RUN_TAR_COMMAND_FILE "${CMAKE_BINARY_DIR}/run-tar-${TARGET}.cmake")
SET(RUN_TAR_COMMAND_FILE "${CMAKE_BINARY_DIR}/cmake-run/run-tar-${TARGET}.cmake")
FILE(WRITE ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo mkdir -p ${CMAKE_BINARY_DIR}/tmp/${TARGET})\n")
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo rm -rf ${CMAKE_BINARY_DIR}/tmp/${TARGET})\n")
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/tmp/${TARGET})\n")
Expand Down Expand Up @@ -313,7 +344,7 @@ macro(gen_server APP TARGET)
FILE(APPEND ${TARS_TAR} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -P ${RUN_TAR_COMMAND_FILE})\n")

#make upload #########################################################################
SET(RUN_UPLOAD_COMMAND_FILE "${PROJECT_BINARY_DIR}/run-upload-${TARGET}.cmake")
SET(RUN_UPLOAD_COMMAND_FILE "${PROJECT_BINARY_DIR}/cmake-run/run-upload-${TARGET}.cmake")
IF(WIN32)
FILE(WRITE ${RUN_UPLOAD_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo ${TARS_WEB_HOST}/api/upload_and_publish -Fsuse=@${TARGET}.tgz -Fapplication=${APP} -Fmodule_name=${TARGET} -Fcomment=developer-auto-upload)\n")
FILE(APPEND ${RUN_UPLOAD_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${TARS_PATH}/thirdparty/bin/curl.exe ${TARS_WEB_HOST}/api/upload_and_publish?ticket=${TARS_TOKEN} -Fsuse=@${TARGET}.tgz -Fapplication=${APP} -Fmodule_name=${TARGET} -Fcomment=developer-auto-upload)\n")
Expand All @@ -336,7 +367,7 @@ macro(gen_server APP TARGET)

#make upload-tars #########################################################################
if (TARS_INPUT)
SET(RUN_UPLOAD_TARS_COMMAND_FILE "${PROJECT_BINARY_DIR}/run-upload-tars-${TARGET}.cmake")
SET(RUN_UPLOAD_TARS_COMMAND_FILE "${PROJECT_BINARY_DIR}/cmake-run/run-upload-tars-${TARGET}.cmake")

IF(WIN32)
FILE(WRITE ${RUN_UPLOAD_TARS_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo ${TARS_WEB_HOST}/api/upload_tars_file -Fsuse=@${TARGET}-merge.tars -Fapplication=${APP} -Fserver_name=${TARGET})\n")
Expand Down Expand Up @@ -366,7 +397,7 @@ macro(gen_server APP TARGET)


#make k8s upload #########################################################################
SET(RUN_K8S_UPLOAD_COMMAND_FILE "${CMAKE_BINARY_DIR}/run-k8s-upload-${TARGET}.cmake")
SET(RUN_K8S_UPLOAD_COMMAND_FILE "${CMAKE_BINARY_DIR}/cmake-run/run-k8s-upload-${TARGET}.cmake")
FILE(WRITE ${RUN_K8S_UPLOAD_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo ${TARS_K8S_WEB_HOST}/pages/k8s/api/upload_and_publish -Fsuse=@${TARGET}.tgz -Fapplication=${APP} -Fmodule_name=${TARGET} -Fserver_type=cpp -Fbase_image=${TARS_K8S_BASE_IMAGE} -Fcomment=developer-auto-upload)\n")
FILE(APPEND ${RUN_K8S_UPLOAD_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND curl ${TARS_K8S_WEB_HOST}/pages/k8s/api/upload_and_publish?ticket=${TARS_K8S_TOKEN} -Fsuse=@${TARGET}.tgz -Fapplication=${APP} -Fmodule_name=${TARGET} -Fserver_type=cpp -Fbase_image=${TARS_K8S_BASE_IMAGE} -Fcomment=developer-auto-upload)\n")
FILE(APPEND ${RUN_K8S_UPLOAD_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo \n---------------------------------------------------------------------------)\n")
Expand Down Expand Up @@ -399,7 +430,7 @@ macro(gen_server APP TARGET)
endif ()

#make release #########################################################################
SET(RUN_RELEASE_COMMAND_FILE "${PROJECT_BINARY_DIR}/run-release-${TARGET}.cmake")
SET(RUN_RELEASE_COMMAND_FILE "${PROJECT_BINARY_DIR}/cmake-run/run-release-${TARGET}.cmake")

if (TARS_INPUT)
if(WIN32)
Expand Down Expand Up @@ -488,6 +519,7 @@ message("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
message("PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
message("CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message("PLATFORM: ${PLATFORM}")
message("ENABLE_SHARED: ${ENABLE_SHARED}")
message("TARS2CPP: ${TARS2CPP}")
message("TARSMERGE: ${TARSMERGE}")
message("TARS_MYSQL: ${TARS_MYSQL}")
Expand All @@ -498,5 +530,16 @@ message("TARS_TOKEN: ${TARS_TOKEN}")
message("TARS_K8S_WEB_HOST: ${TARS_K8S_WEB_HOST}")
message("TARS_K8S_BASE_IMAGE: ${TARS_K8S_BASE_IMAGE}")
message("TARS_K8S_TOKEN: ${TARS_K8S_TOKEN}")
if(TARS_MYSQL)
message("LIB_MYSQL: ${LIB_MYSQL}")
endif()
if(TARS_SSL)
message("LIB_SSL: ${LIB_SSL}")
message("LIB_CRYPTO: ${LIB_CRYPTO}")
endif()
if(TARS_HTTP2)
message("LIB_HTTP2: ${LIB_HTTP2}")
endif()

message("-------------------------------------------------------------------------------------")

1 change: 1 addition & 0 deletions tools/pb2tarscpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ aux_source_directory(. DIR_SRCS)

add_executable(pb2tarscpp ${DIR_SRCS})

add_dependencies(pb2tarscpp thirdparty)

target_link_libraries(pb2tarscpp ${LIB_PROTOBUF} ${LIB_PROTOC})

Expand Down
6 changes: 6 additions & 0 deletions util/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@ if(ENABLE_SHARED)
if (WIN32)
#windows动态编译需添加依赖库
target_link_libraries(tarsutil_shared ${LIB_SSL}.lib ${LIB_CRYPTO}.lib Crypt32)
else()
target_link_libraries(tarsutil_shared ${LIB_SSL} ${LIB_CRYPTO})
endif ()
endif()

if(TARS_HTTP2)
target_link_libraries(tarsutil_shared nghttp2)
endif()
add_dependencies(tarsutil_shared thirdparty)

install(TARGETS tarsutil_shared
Expand Down

0 comments on commit 40c6293

Please sign in to comment.