Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: windows clang fixes #1671

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8b9a076
trying to enable clang for windows msvc
jadebenn Dec 4, 2024
da45152
clang cl toolset
jadebenn Dec 4, 2024
edc7109
update presets
jadebenn Dec 4, 2024
f4082cc
formatting
jadebenn Dec 4, 2024
6c8bb74
Remove user-specific clang configurations
Jettford Dec 4, 2024
6eea3f3
Fix up ZLib a little more and remove more configuration into CMakeLists
Jettford Dec 5, 2024
ece0e29
I made this mistake years ago, my bad
Jettford Dec 5, 2024
83e08f6
remove test and workflow presets
Jettford Dec 8, 2024
10e64a5
re-add testPresets
Jettford Dec 8, 2024
fa017b6
Merge branch 'main' into windows-clang-fixes
Jettford Dec 8, 2024
0d45403
last CI test for tonight
Jettford Dec 8, 2024
628f6b4
Merge remote-tracking branch 'upstream/main' into windows-clang-fixes
jadebenn Dec 8, 2024
4b99b98
attempted CI fix (feel free to revert)
jadebenn Dec 8, 2024
0772e56
remove workflow presets (for now) and try another CI fix
jadebenn Dec 8, 2024
9be88b3
ci fix
jadebenn Dec 8, 2024
3760ffa
presets and workflow changes
Jettford Dec 9, 2024
5a05622
append configureType to matrix
Jettford Dec 9, 2024
51070d4
remove default configure step from build
Jettford Dec 9, 2024
1f8ec6e
I'm just trying stuff at this point
Jettford Dec 9, 2024
c20e1fb
urgh
Jettford Dec 9, 2024
fff7bf8
workflow changes
Jettford Dec 9, 2024
5e73fa5
actually configure
Jettford Dec 9, 2024
1f5982e
learning to fucking read
Jettford Dec 9, 2024
4133008
Clean up warnings, fix errors related to testes and how MariaDB moves…
Jettford Dec 11, 2024
ba2c692
switch to using compat
Jettford Dec 11, 2024
9ea616b
hardcoded docker change test
Jettford Dec 11, 2024
a0f2aeb
fix names of workflows
Jettford Dec 11, 2024
92d086c
replace some silly warnings
Jettford Dec 11, 2024
bb9b259
save all artifacts test
Jettford Dec 11, 2024
badde23
fix a few more warnings
Jettford Dec 11, 2024
8e8d015
update CMAKE_BUILD_TYPE setter
Jettford Dec 11, 2024
80d0cd6
Merge branch 'main' into windows-clang-fixes
Jettford Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Build and Update Docker

on:
push:
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Build And Test

on:
push:
Expand All @@ -14,6 +14,13 @@ jobs:
strategy:
matrix:
os: [ windows-2022, ubuntu-22.04, macos-13 ]
include:
- os: windows-2022
configureType: windows-msvc
- os: ubuntu-22.04
configureType: linux-gnu
- os: macos-13
configureType: macos

steps:
- uses: actions/checkout@v4
Expand All @@ -33,20 +40,13 @@ jobs:
- name: cmake
uses: lukka/run-cmake@v10
with:
workflowPreset: "ci-${{matrix.os}}"
configurePreset: "${{matrix.configureType}}"
buildPreset: "ci-${{matrix.os}}"
testPreset: "ci-${{matrix.os}}"

- name: artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{matrix.os}}
path: |
build/*/*Server*
build/*/*.ini
build/*/*.so
build/*/*.dll
build/*/*.dylib
build/*/vanity/
build/*/navmeshes/
build/*/migrations/
build/*/*.dcf
!build/*/*.pdb
!build/*/d*/
build/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ CMakeFiles/TargetDirectories.txt
*.sln
*.recipe

CMakeUserPresets.json

# clangd
.cache
thirdparty/zlib-1.2.11/
Expand Down
53 changes: 32 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Export the compile commands for debuggi
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) # Set CMAKE visibility policy to NEW on project and subprojects
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C and C++ symbol visibility to hide inlined functions
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel")

if (${CMAKE_BUILD_TYPE} MATCHES "") # CI likes to set CMAKE_BUILD_TYPE to an empty string
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()

set(DLU_CONFIG_DIR ${CMAKE_SOURCE_DIR}/build CACHE PATH "The directory where the server configuration files are stored")

# Read variables from file
FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables)
Expand Down Expand Up @@ -72,7 +80,7 @@ if(UNIX)

# For all except Clang and Apple Clang
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options("-static-libgcc" "-lstdc++fs")
add_compile_options("-static-libgcc" "-lstdc++fs" "-Wno-error=implicit-function-declaration" "-Wno-error=int-conversion")
endif()

if(${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand All @@ -90,10 +98,11 @@ elseif(WIN32)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()

# Our output dir
#set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) # unfortunately, forces all libraries to be built in series, which will slow down the build process
# Set the output directories
# ./build/<platform + architecture (x64, x86, aarch64)>/<compiler>/<build_mode>/

set(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_BUILD_TYPE})

# TODO make this not have to override the build type directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
Expand All @@ -108,6 +117,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

# Get DLU config directory
if(DEFINED ENV{DLU_CONFIG_DIR})
set(DLU_CONFIG_DIR $ENV{DLU_CONFIG_DIR})
else()
set(DLU_CONFIG_DIR ${CMAKE_BINARY_DIR})
endif()

message(STATUS "Configuration Directory is ${DLU_CONFIG_DIR}, and the build directory is ${CMAKE_BINARY_DIR}")

find_package(MariaDB)

# Create a /resServer directory
Expand All @@ -116,18 +134,11 @@ make_directory(${CMAKE_BINARY_DIR}/resServer)
# Create a /logs directory
make_directory(${CMAKE_BINARY_DIR}/logs)

# Get DLU config directory
if(DEFINED ENV{DLU_CONFIG_DIR})
set(DLU_CONFIG_DIR $ENV{DLU_CONFIG_DIR})
else()
set(DLU_CONFIG_DIR ${PROJECT_BINARY_DIR})
endif()
message(STATUS "Variable: DLU_CONFIG_DIR = ${DLU_CONFIG_DIR}")

# Copy resource files on first build
set(RESOURCE_FILES "sharedconfig.ini" "authconfig.ini" "chatconfig.ini" "worldconfig.ini" "masterconfig.ini" "blocklist.dcf")
message(STATUS "Checking resource file integrity")


include(Utils)
UpdateConfigOption(${DLU_CONFIG_DIR}/authconfig.ini "port" "auth_server_port")
UpdateConfigOption(${DLU_CONFIG_DIR}/chatconfig.ini "port" "chat_server_port")
Expand Down Expand Up @@ -196,15 +207,15 @@ endforeach()
message(STATUS "Resource file integrity check complete")

# if navmeshes directory does not exist, create it
if(NOT EXISTS ${PROJECT_BINARY_DIR}/navmeshes)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/navmeshes)
if(NOT EXISTS ${CMAKE_BINARY_DIR}/navmeshes)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/navmeshes)
endif()

# Copy navmesh data on first build and extract it
configure_file(${CMAKE_SOURCE_DIR}/resources/navmeshes.zip ${PROJECT_BINARY_DIR}/navmeshes.zip COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/resources/navmeshes.zip ${CMAKE_BINARY_DIR}/navmeshes.zip COPYONLY)

file(ARCHIVE_EXTRACT INPUT ${PROJECT_BINARY_DIR}/navmeshes.zip DESTINATION ${PROJECT_BINARY_DIR}/navmeshes)
file(REMOVE ${PROJECT_BINARY_DIR}/navmeshes.zip)
file(ARCHIVE_EXTRACT INPUT ${CMAKE_BINARY_DIR}/navmeshes.zip DESTINATION ${CMAKE_BINARY_DIR}/navmeshes)
file(REMOVE ${CMAKE_BINARY_DIR}/navmeshes.zip)

# Copy vanity files on first build
set(VANITY_FILES "CREDITS.md" "INFO.md" "TESTAMENT.md" "root.xml" "dev-tribute.xml" "atm.xml" "demo.xml")
Expand All @@ -214,20 +225,20 @@ foreach(file ${VANITY_FILES})
endforeach()

# Move our migrations for MasterServer to run
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/dlu/)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/migrations/dlu/)
file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/dlu/*.sql)

foreach(file ${SQL_FILES})
get_filename_component(file ${file} NAME)
configure_file(${CMAKE_SOURCE_DIR}/migrations/dlu/${file} ${PROJECT_BINARY_DIR}/migrations/dlu/${file})
configure_file(${CMAKE_SOURCE_DIR}/migrations/dlu/${file} ${CMAKE_BINARY_DIR}/migrations/dlu/${file})
endforeach()

file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/cdserver/)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/migrations/cdserver/)
file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/cdserver/*.sql)

foreach(file ${SQL_FILES})
get_filename_component(file ${file} NAME)
configure_file(${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${PROJECT_BINARY_DIR}/migrations/cdserver/${file})
configure_file(${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${CMAKE_BINARY_DIR}/migrations/cdserver/${file})
endforeach()

# Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux)
Expand Down
Loading