mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 18:54:13 +00:00
fix: use current binary directory mariadb shared object and dont override env variable (#1669)
* mac stuff grab correct mariadb file and dont override env variable fix for unix Update CMakeLists.txt unix only * get that dylib
This commit is contained in:
@@ -13,14 +13,12 @@ file(COPY ${COMPONENT_TEST_DATA} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Add the executable. Remember to add all tests above this!
|
||||
add_executable(dGameTests ${DGAMETEST_SOURCES})
|
||||
add_dependencies(dGameTests conncpp_tests)
|
||||
|
||||
# Apple needs some special linkage for the mariadb connector for tests.
|
||||
if(APPLE)
|
||||
add_custom_command(TARGET dGameTests POST_BUILD
|
||||
COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dGameTests
|
||||
COMMAND otool ARGS -L dGameTests
|
||||
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
add_custom_target(dGameTestsLink
|
||||
${CMAKE_COMMAND} -E copy $<TARGET_FILE:MariaDB::ConnCpp> ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_dependencies(dGameTests dGameTestsLink)
|
||||
endif()
|
||||
|
||||
target_link_libraries(dGameTests ${COMMON_LIBRARIES} GTest::gtest_main
|
||||
|
Reference in New Issue
Block a user