Skip to content

Commit

Permalink
fix: force link mysql use static library
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanshudong committed Nov 5, 2024
1 parent 63ac42c commit c7e9172
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ macro(complice_module MODULE)
add_dependencies(${MODULE} FRAMEWORK-PROTOCOL)
add_dependencies(${MODULE} tars2cpp)

target_link_libraries(${MODULE} tarsservant tarsutil ${LIB_MYSQL})
target_link_libraries(${MODULE} tarsservant tarsutil)

if(TARS_SSL)
target_link_libraries(${MODULE} ${LIB_SSL} ${LIB_CRYPTO})
Expand All @@ -80,6 +80,12 @@ macro(complice_module MODULE)
target_link_libraries(${MODULE} ${LIB_HTTP2})
endif()

if(NOT WIN32)
target_link_libraries(${MODULE} ${CMAKE_BINARY_DIR}/src/mysql/lib/libmysqlclient.a)
else ()
target_link_libraries(${MODULE} ${LIB_MYSQL})
endif()

if(NOT WIN32)
link_libraries(pthread z dl)
endif()
Expand Down
6 changes: 5 additions & 1 deletion mysql-tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ if(TARS_HTTP2)
target_link_libraries(${MODULE} ${LIB_HTTP2})
endif()

target_link_libraries(mysql-tool ${LIB_MYSQL})
if(NOT WIN32)
target_link_libraries(${MODULE} ${CMAKE_BINARY_DIR}/src/mysql/lib/libmysqlclient.a)
else ()
target_link_libraries(${MODULE} ${LIB_MYSQL})
endif()

install(TARGETS mysql-tool DESTINATION deploy)
6 changes: 5 additions & 1 deletion tars-client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ if(TARS_HTTP2)
target_link_libraries(${MODULE} ${LIB_HTTP2})
endif()

target_link_libraries(tars-client ${LIB_MYSQL})
if(NOT WIN32)
target_link_libraries(${MODULE} ${CMAKE_BINARY_DIR}/src/mysql/lib/libmysqlclient.a)
else ()
target_link_libraries(${MODULE} ${LIB_MYSQL})
endif()

install(TARGETS tars-client DESTINATION deploy)
2 changes: 1 addition & 1 deletion tarscpp
Submodule tarscpp updated 230 files

0 comments on commit c7e9172

Please sign in to comment.