Add CMake builds for server projects (#657)

  • Konuyu Başlatan Konuyu Başlatan twostars
  • Başlangıç tarihi Başlangıç tarihi
  • Öne çıkan
T

twostars

Add CMake builds for server projects (#657)

* Implemented basic CMake build config (builds on Windows/MSVC).

* Removed use of `_CRT_SECURE_NO_WARNINGS` macro (fixing related use cases).

* Fixed 64-bit related warnings (as the default build for MSVC is 64-bit).

* Updated for Clang (Linux) builds (fixing new warnings, any unsupported code).
* Fixed numerous minor warnings (mostly unreferenced or uninitialized vars/parameters).
* Added `strcpy_safe()` to replace `strcpy_s()` usage which mostly mimics `strlcpy` -- it's just a little bit nicer, supporting `std::string_view`.
* Fixed djb2 support.

* Replaced module usage (as used by db-modules) with a standard header/source implementation.
Support is technically possible, but it's extremely challenging and will likely be even worse with gcc.
It didn't even behave that great in VS, so it's probably for the best it just goes.
It should hopefully be more standardized by C++26, so we may reintroduce it eventually.

* Renamed db-modules -> db-models (they're still models but no longer modules).

* Updated for gcc (Linux) builds (new warning fixes, any unsupported code).
* Replaced standard deprecated memcalls (`memcpy(this, ...)`, `memset(this, ...)` - replaced instances these in the client as well for future-proofing.
* Restored regular include guards. gcc choked on at least one case with pure `#pragma once`; presumably the header being included in different ways. Better to just be safe than sorry and use both.
* Replaced unions in `db-modules` (`field1`, `field2`, `field3` & `field[3]`) with just arrays. It's not technically allowed by the standard for non-trivial types (i.e. `std::optional<>` in this case), though gcc is the only one that's strict about this.

* Added consistent default initialization to the various types (mostly math-related) in My_3DStruct.h.
Rather than just override the constructor to do nothing (causing initialization like `= {}` to do nothing, we default initialize it instead. That way it still does nothing by default, but if we explicitly value initialize it like `= {}`, it will initialize each field accordingly (typically zeroed).
This is needed to replace various standard deprecated memcalls on class/struct instances - instead of these being initialized with memset(), we can just use `{}` to initialize them.

* Restored VS debugger working dir for consistency and simplicity when building it for MSVC.

* Tidied up generated VS solution to continue grouping projects (the grouping naturally applies to all IDEs that support it, like CLion).

* Added GitHub workflow for running CMake jobs (Windows - Win32, x64, Linux - gcc [current - 13], clang [current - 18] & clang 20 [bleeding edge]).

* Implemented dependency management through CMake itself to avoid relying on or dealing with submodules (better for seamlessly keeping things up-to-date from a user perspective, though a little more tedious to keep the submodules and CMake config synced for maintainers).

* Tweaked `ByteBuffer` to - firstly - build in gcc/clang and additionally just shift implementation (and template) code into a source file to improve compilation times.

* Added `sync-submodules` project to our regular Visual Studio solutions to ensure submodules are updated correctly on rename/URL change (as was the case with db-modules etc.).

* Fixed some accidentally incorrect log refs (referencing `AiServerInstance` instead of `AujardApp` in Aujard).

* Removed `AIServerApp::TestCode()`. This is useless; it looked like it was causing the random number generator to not start on something consistent, but it's called before `srand()` and logic which does this already.

Resolves #644

Github Commit Görüntüle...
See Commints...

..
 

Similar threads

T
Cevaplar
0
Görüntüleme
9
T
T
Cevaplar
0
Görüntüleme
4
twostars
T
T
Cevaplar
0
Görüntüleme
14
twostars
T
Geri
Üst