Skip to content

Commit

Permalink
Merge branch 'fix-windows-debug' of https://github.com/DarkflameUnive…
Browse files Browse the repository at this point in the history
…rse/DarkflameServer into fix-windows-debug
EmosewaMC committed Oct 28, 2024
2 parents 26a9d2e + bb143cc commit 7513dc6
Showing 4 changed files with 12 additions and 16 deletions.
9 changes: 9 additions & 0 deletions cmake/Utils.cmake
Original file line number Diff line number Diff line change
@@ -49,3 +49,12 @@ function(UpdateConfigOption file_name old_option_name new_option_name)
file(APPEND ${file_name} "\n" ${current_value})
endif()
endfunction()

function(DoAppleMariaDBCopy target location)
if(APPLE)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MARIADBCPP_SHARED_LIBRARY_LOCATION}
${location})
endif()
endfunction()
1 change: 1 addition & 0 deletions dMasterServer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -18,3 +18,4 @@ target_link_libraries(MasterServer ${COMMON_LIBRARIES} bcrypt dMasterServer dSer
if(WIN32)
add_dependencies(MasterServer WorldServer AuthServer ChatServer)
endif()
DoAppleMariaDBCopy(MasterServer ${CMAKE_BINARY_DIR})
11 changes: 1 addition & 10 deletions tests/dCommonTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -22,16 +22,7 @@ if(MSVC)
add_dependencies(dCommonTests zlib_tests)
endif()
# Apple needs some special linkage for the mariadb connector for tests.
if(APPLE)
add_custom_command(TARGET dCommonTests POST_BUILD
COMMAND otool ARGS -l dCommonTests
COMMAND otool ARGS -L dCommonTests
COMMAND ls
COMMAND otool ARGS -D libmariadbcpp.dylib
COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dCommonTests
COMMAND otool ARGS -L dCommonTests
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()
DoAppleMariaDBCopy(dCommonTests ${CMAKE_CURRENT_BINARY_DIR})

# Link needed libraries
target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main)
7 changes: 1 addition & 6 deletions tests/dGameTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -15,12 +15,7 @@ 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})
endif()
DoAppleMariaDBCopy(dGameTests ${CMAKE_CURRENT_BINARY_DIR})

target_link_libraries(dGameTests ${COMMON_LIBRARIES} GTest::gtest_main
dGame dScripts dPhysics Detour Recast tinyxml2 dWorldServer dZoneManager dChatFilter dNavigation)

0 comments on commit 7513dc6

Please sign in to comment.