mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-16 20:24:39 -06:00
Compare commits
5 Commits
v3.0.1
...
fix-window
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7513dc6f49 | ||
|
|
26a9d2eaaa | ||
|
|
bb143ccf21 | ||
|
|
0509aaf855 | ||
|
|
e0b54645dc |
9
.github/workflows/build-and-test.yml
vendored
9
.github/workflows/build-and-test.yml
vendored
@@ -8,12 +8,13 @@ on:
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: Build & Test (${{ matrix.os }})
|
||||
name: Build & Test (${{ matrix.os }} - ${{ matrix.cfg }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ windows-2022, ubuntu-22.04, macos-13 ]
|
||||
cfg: [ debug, release ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -33,9 +34,9 @@ jobs:
|
||||
- name: cmake
|
||||
uses: lukka/run-cmake@v10
|
||||
with:
|
||||
configurePreset: "ci-${{matrix.os}}"
|
||||
buildPreset: "ci-${{matrix.os}}"
|
||||
testPreset: "ci-${{matrix.os}}"
|
||||
configurePreset: "ci-${{matrix.os}}-${{matrix.cfg}}"
|
||||
buildPreset: "ci-${{matrix.os}}-${{matrix.cfg}}"
|
||||
testPreset: "ci-${{matrix.os}}-${{matrix.cfg}}"
|
||||
- name: artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
@@ -14,34 +14,80 @@
|
||||
"generator": "Unix Makefiles"
|
||||
},
|
||||
{
|
||||
"name": "ci-ubuntu-22.04",
|
||||
"displayName": "CI configure step for Ubuntu",
|
||||
"description": "Same as default, Used in GitHub actions workflow",
|
||||
"inherits": "default"
|
||||
},
|
||||
{
|
||||
"name": "ci-macos-13",
|
||||
"displayName": "CI configure step for MacOS",
|
||||
"description": "Same as default, Used in GitHub actions workflow",
|
||||
"inherits": "default"
|
||||
},
|
||||
{
|
||||
"name": "ci-windows-2022",
|
||||
"displayName": "CI configure step for Windows",
|
||||
"description": "Set architecture to 64-bit (b/c RakNet)",
|
||||
"name": "ci-debug",
|
||||
"displayName": "CI configure step for Debug",
|
||||
"inherits": "default",
|
||||
"generator": "Visual Studio 17 2022",
|
||||
"architecture": {
|
||||
"value": "x64"
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-release",
|
||||
"displayName": "CI configure step for Release",
|
||||
"inherits": "default",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-default",
|
||||
"inherits": "ci-windows-2022",
|
||||
"displayName": "Windows only Configure Settings",
|
||||
"name": "ci-ubuntu-22.04-release",
|
||||
"displayName": "CI configure step for Ubuntu",
|
||||
"description": "Same as default, Used in GitHub actions workflow",
|
||||
"inherits": "ci-release"
|
||||
},
|
||||
{
|
||||
"name": "ci-ubuntu-22.04-debug",
|
||||
"displayName": "CI configure step for Ubuntu",
|
||||
"description": "Same as default, Used in GitHub actions workflow",
|
||||
"inherits": "ci-debug"
|
||||
},
|
||||
{
|
||||
"name": "ci-macos-13-release",
|
||||
"displayName": "CI configure step for MacOS",
|
||||
"description": "Same as default, Used in GitHub actions workflow",
|
||||
"inherits": "ci-release"
|
||||
},
|
||||
{
|
||||
"name": "ci-macos-13-debug",
|
||||
"displayName": "CI configure step for MacOS",
|
||||
"description": "Same as default, Used in GitHub actions workflow",
|
||||
"inherits": "ci-debug"
|
||||
},
|
||||
{
|
||||
"name": "ci-windows-2022-release",
|
||||
"displayName": "CI configure step for Windows",
|
||||
"description": "Set architecture to 64-bit (b/c RakNet)",
|
||||
"inherits": "ci-release",
|
||||
"generator": "Visual Studio 17 2022",
|
||||
"architecture": {
|
||||
"value": "x64"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-windows-2022-debug",
|
||||
"displayName": "CI configure step for Windows",
|
||||
"description": "Set architecture to 64-bit (b/c RakNet)",
|
||||
"inherits": "ci-debug",
|
||||
"generator": "Visual Studio 17 2022",
|
||||
"architecture": {
|
||||
"value": "x64"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-default-release",
|
||||
"inherits": "ci-windows-2022-release",
|
||||
"displayName": "Windows only Configure Settings (Release)",
|
||||
"description": "Sets build and install directories",
|
||||
"generator": "Ninja",
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "external"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-default-debug",
|
||||
"inherits": "ci-windows-2022-debug",
|
||||
"displayName": "Windows only Configure Settings (Debug)",
|
||||
"description": "Sets build and install directories",
|
||||
"generator": "Ninja",
|
||||
"architecture": {
|
||||
@@ -59,34 +105,57 @@
|
||||
"jobs": 2
|
||||
},
|
||||
{
|
||||
"name": "ci-windows-2022",
|
||||
"configurePreset": "ci-windows-2022",
|
||||
"name": "ci-windows-2022-debug",
|
||||
"configurePreset": "ci-windows-2022-debug",
|
||||
"displayName": "Windows CI Build",
|
||||
"description": "This preset is used by the CI build on windows",
|
||||
"configuration": "RelWithDebInfo",
|
||||
"jobs": 2
|
||||
"inherits": "default"
|
||||
},
|
||||
{
|
||||
"name": "ci-ubuntu-22.04",
|
||||
"configurePreset": "ci-ubuntu-22.04",
|
||||
"name": "ci-windows-2022-release",
|
||||
"configurePreset": "ci-windows-2022-release",
|
||||
"displayName": "Windows CI Build",
|
||||
"description": "This preset is used by the CI build on windows",
|
||||
"configuration": "RelWithDebInfo",
|
||||
"inherits": "default"
|
||||
},
|
||||
{
|
||||
"name": "ci-ubuntu-22.04-debug",
|
||||
"configurePreset": "ci-ubuntu-22.04-debug",
|
||||
"displayName": "Linux CI Build",
|
||||
"description": "This preset is used by the CI build on linux",
|
||||
"jobs": 2
|
||||
"inherits": "default"
|
||||
},
|
||||
{
|
||||
"name": "ci-macos-13",
|
||||
"configurePreset": "ci-macos-13",
|
||||
"name": "ci-ubuntu-22.04-release",
|
||||
"configurePreset": "ci-ubuntu-22.04-release",
|
||||
"displayName": "Linux CI Build",
|
||||
"description": "This preset is used by the CI build on linux",
|
||||
"inherits": "default"
|
||||
},
|
||||
{
|
||||
"name": "ci-macos-13-debug",
|
||||
"configurePreset": "ci-macos-13-debug",
|
||||
"displayName": "MacOS CI Build",
|
||||
"description": "This preset is used by the CI build on MacOS",
|
||||
"jobs": 2
|
||||
"inherits": "default"
|
||||
},
|
||||
{
|
||||
"name": "ci-macos-13-release",
|
||||
"configurePreset": "ci-macos-13-release",
|
||||
"displayName": "MacOS CI Build",
|
||||
"description": "This preset is used by the CI build on MacOS",
|
||||
"inherits": "default"
|
||||
}
|
||||
],
|
||||
"testPresets": [
|
||||
{
|
||||
"name": "ci-ubuntu-22.04",
|
||||
"configurePreset": "ci-ubuntu-22.04",
|
||||
"name": "ci-ubuntu-22.04-debug",
|
||||
"configurePreset": "ci-ubuntu-22.04-debug",
|
||||
"displayName": "CI Tests on Linux",
|
||||
"description": "Runs all tests on a linux configuration",
|
||||
"configuration": "Debug",
|
||||
"execution": {
|
||||
"jobs": 2
|
||||
},
|
||||
@@ -95,10 +164,24 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-macos-13",
|
||||
"configurePreset": "ci-macos-13",
|
||||
"name": "ci-ubuntu-22.04-release",
|
||||
"configurePreset": "ci-ubuntu-22.04-release",
|
||||
"displayName": "CI Tests on Linux",
|
||||
"description": "Runs all tests on a linux configuration",
|
||||
"configuration": "RelWithDebInfo",
|
||||
"execution": {
|
||||
"jobs": 2
|
||||
},
|
||||
"output": {
|
||||
"outputOnFailure": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-macos-13-debug",
|
||||
"configurePreset": "ci-macos-13-debug",
|
||||
"displayName": "CI Tests on MacOS",
|
||||
"description": "Runs all tests on a Mac configuration",
|
||||
"configuration": "Debug",
|
||||
"execution": {
|
||||
"jobs": 2
|
||||
},
|
||||
@@ -107,8 +190,21 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-windows-2022",
|
||||
"configurePreset": "ci-windows-2022",
|
||||
"name": "ci-macos-13-release",
|
||||
"configurePreset": "ci-macos-13-release",
|
||||
"displayName": "CI Tests on MacOS",
|
||||
"description": "Runs all tests on a Mac configuration",
|
||||
"configuration": "RelWithDebInfo",
|
||||
"execution": {
|
||||
"jobs": 2
|
||||
},
|
||||
"output": {
|
||||
"outputOnFailure": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-windows-2022-release",
|
||||
"configurePreset": "ci-windows-2022-release",
|
||||
"displayName": "CI Tests on windows",
|
||||
"description": "Runs all tests on a windows configuration",
|
||||
"configuration": "RelWithDebInfo",
|
||||
@@ -123,6 +219,24 @@
|
||||
"name": "((example)|(minigzip))+"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-windows-2022-debug",
|
||||
"configurePreset": "ci-windows-2022-debug",
|
||||
"displayName": "CI Tests on windows",
|
||||
"description": "Runs all tests on a windows configuration for debug",
|
||||
"configuration": "Debug",
|
||||
"execution": {
|
||||
"jobs": 2
|
||||
},
|
||||
"output": {
|
||||
"outputOnFailure": true
|
||||
},
|
||||
"filter": {
|
||||
"exclude": {
|
||||
"name": "((example)|(minigzip))+"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -15,6 +15,11 @@ endif()
|
||||
add_custom_target(conncpp_tests
|
||||
${CMAKE_COMMAND} -E copy $<TARGET_FILE:MariaDB::ConnCpp> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
|
||||
if(MSVC)
|
||||
add_custom_target(zlib_tests
|
||||
${CMAKE_COMMAND} -E copy $<TARGET_FILE:ZLIB::ZLIB> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
|
||||
# Add the subdirectories
|
||||
add_subdirectory(dCommonTests)
|
||||
add_subdirectory(dGameTests)
|
||||
|
||||
@@ -18,18 +18,11 @@ list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS})
|
||||
# Set our executable
|
||||
add_executable(dCommonTests ${DCOMMONTEST_SOURCES})
|
||||
add_dependencies(dCommonTests conncpp_tests)
|
||||
|
||||
# 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})
|
||||
if(MSVC)
|
||||
add_dependencies(dCommonTests zlib_tests)
|
||||
endif()
|
||||
# Apple needs some special linkage for the mariadb connector for tests.
|
||||
DoAppleMariaDBCopy(dCommonTests ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Link needed libraries
|
||||
target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user