Initial support to automate release flow. Now after git tag of specific commit GitHub Actions will create a draft entry of release (named by tag) with source code package on it.
We already add /GL (Whole Program Optimization) to the compiler flags in Release builds. By not using /LTCG for the linker, the build output will be spammed with following message:
MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Consider this program:
#include <cstdio>
int main(void) {
const char *example_string = "ディセント3";
for (size_t i = 0; example_string[i] != '\0'; ++i) {
printf("%02hhx ", example_string[i]);
}
puts("");
return 0;
}
What will that program output? The answer is: it depends. If that
program is compiled with a UTF-8 execution character set, then it will
print this:
e3 83 87 e3 82 a3 e3 82 bb e3 83 b3 e3 83 88 33
If that program is compiled with a Shift JIS execution character set,
then it will print this:
83 66 83 42 83 5a 83 93 83 67 33
This is especially a problem when using MSVC. MSVC doesn’t necessarily
default to using UTF-8 as a program’s execution character set [1].
---
Before this change, Descent 3 would use whatever the default execution
character set was. This commit ensures that the execution character set
is UTF-8 as long as Descent 3 gets compiled with MSVC, GCC or Clang. If
Descent 3 is compiled with a different compiler, then a different
execution character set might get used, but as far as I know, we only
support MSVC, GCC and Clang.
I’m not sure whether or not this change has any noticeable effects. If
using different execution character sets do have noticeable effects,
then this change will hopefully ensure that those effects are the same
for everyone.
[1]: <https://learn.microsoft.com/en-us/answers/questions/1805730/what-is-msvc-s-default-execution-character-set>
Before this change, there was a chance that a text editor or compiler
would use the wrong character encoding. For text editors, this commit
adds “charset = utf-8” to .editorconfig. That will cause editors that
support EditorConfig files [1] to automatically use UTF-8 when reading
and writing files. For compilers, this commit adds compiler options that
guarantee that compilers will decode source code files using UTF-8. The
compiler options are known to work on MSVC, GCC and Clang. If we ever
want to support additional compilers, then we might have to edit the if
statement that this commit adds.
This commit does not eliminate the chance that a wrong character
encoding will be used. Someone could always use a text editor that
doesn’t support EditorConfig files or a compiler that doesn’t support
the compiler options that we use. This commit does, however, make an
encoding mismatch much less likely.
[1]: <https://editorconfig.org/#pre-installed>
MEM_USE_RTL is used in lib/mem.h to switch between different implementations of memory managment functions. Since mem.h gets included by a lot of libs, all these libs need to be compiled with the same define.
cmake/CheckGit.cmake uses configure_file() to create d3_version.h in ${TARGET_DIR}/lib aka ${PROJECT_BINARY_DIR}/lib. But add_custom_command() and add_custom_target() calls in the root CMakeLists.txt use ${PROJECT_BINARY_DIR}/Descent3 as path to that file, expecting it in a different place. While the build still works, since the compiler looks in the right include paths for it, the dependencies between these rules/targets are technically broken. At least msbuild will generate warnings about missing build outputs.
Also removed the wrong ALL parameter from add_custom_command(), it's only a valid parameter for add_custom_target().
Use Real-time library memory functions by default which improves overall performance. Minor cleanups.
Introduce new CMake option to enable/disable RTL memory functions (enabled by default).
- Add macro PRIMARY_HOG to define the hardcoded hog filename to load.
- Replace instances of "LINUX" with "__LINUX__"
- Remove these macros entirely because they are (now) unused
- LINUX
- _REENRANT
- __32BIT__
- Removed from CMakeFile.txt because they are in linux_fix.h
- _MAX_PATH=260
- _MAX_FNAME=256
This type of console is enabled only with `-svgalib` and `-dedicated` options. Since there no svgalib direct support (which is pretty old and too specific to Linux tech), it's better completely remove this code for simplicity and reducing external dependencies.
Removed `-svgalib` option as unused now.
Before this change, CMakeLists.txt would run find_package(OpenGL), but
it would never use any of the targets or variables that calling
find_package(OpenGL) produces [1]. As a result, the call to
find_package(OpenGL) didn’t really do anything.
[1]: <https://cmake.org/cmake/help/latest/module/FindOpenGL.html>
Added installation steps for all built targets. Added FORCE_PORTABLE_INSTALL cmake option that controls portable installation (only supported for now).
Before this change, users would have to jump through hoops in order to
make sure that they’re using the .d3m files from this repo (as opposed
to the .d3m files that came with their version of Descent 3).
Specifically, users would have to remove or backup Descent 3’s original
netgames/ directory, create a new one, hunt down TCP_IP.d3c and copy it
to the new netgames/ directory.
This change makes it easier for users to use the latest version of
working by creating a netgames/ directory for them. All they have to do
is replace the old one with the new one.
Fixes#369.