Commit Graph

136 Commits

Author SHA1 Message Date
Azamat H. Hackimov
c3e0102a4f Implementing C++ byteswap functions
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.
2024-04-23 21:18:07 +03:00
Jacob Coby
96ce6d2c73 Logging updates:
* Adds CMake Option
 * Adds LOGGER to the README
 * Removes MONO define in favor of LOGGER
2024-04-23 13:53:00 -04:00
Jacob Coby
9753f8367f Enable console logging if MONO or LOGGER is defined
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
2024-04-23 09:07:20 -04:00
Kevin Bentley
1fd8876f60
Merge pull request #135 from DanielGibson/use-libacm
Use upstream libacm 1.3 for ACM audio decoding
2024-04-21 13:46:27 -06:00
Daniel Gibson
f61f34971d Add FORCE_COLORED_OUTPUT option (for GCC and Clang) to CMakeLists.txt
To enforce colorful compiler warnings when building with Ninja
(and GCC/Clang) on Linux and similar platforms.

Taken from dhewm3 (where I implemented it).
2024-04-21 18:21:42 +02:00
Azamat H. Hackimov
fb0dabc367 Implementing HogMaker replacement of HogUtils
Currently, this tool can make only create HOG from list of files taken from text file (one line per file).
2024-04-21 19:15:23 +03:00
Thomas Roß
9d2496f28b [Build] Only set preprocessor define _DEBUG in Debug builds.
Linux and Mac had this set on all build configurations.
2024-04-21 15:14:31 +02:00
Thomas Roß
480b6ad0ed [Build] Added missing RELEASE preprocessor define in Release build. 2024-04-21 14:11:45 +02:00
Thomas Otto
00389c50ea Some more CMake white space formatting
- 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
2024-04-21 11:46:32 +02:00
Thomas Otto
9b1f6a3178 Remove -fpermissive and -Wno-address-of-temporary flags 2024-04-20 17:22:27 +02:00
Louis Gombert
ac2b95b645 Remove deprecated CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 2024-04-20 14:45:49 +02:00
Louis Gombert
c2b71b8147 Standardize CMake formatting
lowercase function names, blocks indent
2024-04-20 14:45:49 +02:00
Louis Gombert
4b53454c0f Remove D3_GAMEDIR hard-coded CMake variable 2024-04-20 13:02:40 +02:00
Jeod
1fb980d2b1
Merge pull request #87 from Arcnor/msvc-warnings
enable stricter MSVC warnings, fix some of them
2024-04-19 12:15:03 -04:00
Edu Garcia
066b436fd9
Revert "Cfile module update" 2024-04-19 13:57:55 +01:00
Edu Garcia
6e772ca4da enable stricter MSVC warnings, fix some of them 2024-04-19 12:38:44 +01:00
Edu Garcia
09cb56f269
Merge pull request #76 from winterheart/cfile-update
Cfile module update
2024-04-19 11:02:58 +01:00
Azamat H. Hackimov
9b45091633 Rename/move cfile related files
Rename to lowercase and move headers to own directory.
2024-04-19 00:17:15 +03:00
Jacob Coby
95f1cad545 Remove MONO define
Fixes `mprintf` and `mprintf_at` calls from causing a segfault.

MONO was used to output debugging info to a monochrome monotor.
2024-04-18 17:15:32 -04:00
Louis Gombert
c68d6419c9 Linux-clang: also apply -Wno-address-of-temporary 2024-04-18 19:15:58 +02:00
Jason Yundt
0dfbcb5076 Allow user to specify additional compiler flags
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
2024-04-18 07:21:43 -04:00
Azamat H. Hackimov
3f7666eaac Fixes and enhancements to CMake build system
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.
2024-04-18 03:04:16 +03:00
Thomas Otto
b909a4cf43 Convert min/max macros to std::min/max
Added explicit <float> or <int> template argument where needed.
Add -DNOMINMAX define for Windows.
2024-04-17 21:43:38 +02:00
Louis Gombert
4d181c8ab3
Merge pull request #20 from th1000s/cmake_unix
Set C++ to 17, and a few CMake fixes for Linux
2024-04-17 18:39:51 +00:00
Jacob Coby
531e528c61 Apple M-Series Fixes
* Adds portable debug_break (https://github.com/scottt/debugbreak/)
 * Adds Brewfile for Homebrew deps
 * use isfinite() instead of finite()
 * Stub int3 code in mveasm
2024-04-17 09:09:22 -04:00
Thomas Otto
26266d625c Unix: set -std=c++17 explicitly
remove register keyword, add cstdint include
2024-04-17 01:38:18 +02:00
Thomas Otto
67d68f1f4d Unix: CMakeLists.txt compat fixes, suppress fewer warnings
`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.
2024-04-17 01:38:18 +02:00
Dan Raviv
116f3d6753 CMake avoid setting 32-bit arch on macOS which doesn't support it anymore 2024-04-16 13:02:45 -07:00
Dan Raviv
ffd5dadc04 Remove redundant CMAKE_CXX_FLAGS_DEBUG setting 2024-04-16 13:02:45 -07:00
Dan Raviv
60f9e4c52a Suppress -Waddress-of-temporary errors
At least temporarily. There are a lot of those
2024-04-16 13:00:23 -07:00
Dan Raviv
b03f9e0478 Limit macOS scope to x86_64 for now
Got some arm64-related errors, which is to be expected.
2024-04-16 13:00:23 -07:00
Dan Raviv
b27418e9fd CMake works with brew-installed sdl2_image on macOS 2024-04-16 13:00:23 -07:00
Dan Raviv
9c85637677 Use default CMAKE_FIND_LIBRARY_SUFFIXES
On macOS, CMake now successfully finds Homebrew's sdl12-compat libSDL.dylib
2024-04-16 13:00:23 -07:00
Jacob Coby
25af8a75a4 Removes AngelScript
Unused and fixes compile errors on multiple platforms. #10 #12
2024-04-16 15:06:32 -04:00
Edu Garcia
8e350a6c5d minimal changes for compilation (including linking) under Windows 2024-04-16 14:45:15 +01:00
Kevin Bentley
df209742fc Initial import 2024-04-15 21:43:29 -06:00