Commit Graph

23 Commits

Author SHA1 Message Date
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