Implementing byteswap functions by using "backported" from C++23 std::byteswap.
Adding unittests based on GoogleTests. To enable it add `-DBUILD_TESTING=ON` to cmake.
Re-enable console logging on linux and mac builds with the -DMONO
option.
Rename overloaded Debug_ConsolePrintf function to
Debug_ConsolePrintfAt to fix macro expansion.
Adds -DLOGGER alias for -DMONO.
Implements #157
To enforce colorful compiler warnings when building with Ninja
(and GCC/Clang) on Linux and similar platforms.
Taken from dhewm3 (where I implemented it).
- tabs to spaces
- use Unix line endings everywhere
- newline at end of file
- remove trailing white space
- no space between keywords and opening parenthesis
- use 2 spaces to indent
I’m trying to compile Descent 3 on NixOS, but when I run
“cmake --build <path>”, I get this error:
/home/jayman/Documents/Home/VC/Git/Partially mine/Descent3/repo/Descent3/multi_connect.cpp: In function 'int TryToJoinServer(network_address*)':
/home/jayman/Documents/Home/VC/Git/Partially mine/Descent3/repo/Descent3/multi_connect.cpp:358:16: error: format not a string literal and no format arguments [-Werror=format-security]
358 | sprintf(str, TXT(Join_response_strings[Ok_to_join]));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Eventually, we should actually fix that sprintf call (and any other
calls that would trigger format security warnings), but it would be nice
if users could just temporarily ignore stuff like that.
This commit makes it so that users can set custom complier flags by
doing this:
$ cmake \
--preset <preset> \
-B build \
-DCMAKE_C_FLAGS=<additional-c-flags> \
-DCMAKE_CXX_FLAGS=<additional-cxx-flags>
$ cmake --build build
Updated compatibility level to 3.19. Set C++17 globally for all platforms. Removed hardcoded compiler and optimisation flags. Adjusted dependencies and libraries linking.
Reworked script building and hog creation.
`LIST(APPEND ..)` adds a `;` to the gcc command line, replaced with string
interpolation.
Only use "-Wno-address-of-temporary" on macOS (=clang),
on Linux/gcc use "-fpermissive" which still shows the compiler warning
so it can be fixed later.