TiManGames / AmnesiaTheDarkDescent

GNU General Public License v3.0
30 stars 8 forks source link

Unify build versioning #22

Closed jkulawik closed 4 weeks ago

jkulawik commented 1 month ago

At the moment, there's several build ID headers that had to be generated with some external tool.

These should be unified / updated to not compile the editors with a 2010 date.

This article describes how it could be done using CMake.

jkulawik commented 1 month ago

I can't get CMake's add_custom_command to work. Also the original build systems needs way too many extra files, requires perl to work, only updates the IDs when CMake is ran, and generates VCS changes with each build.

It seems like it would be much better to use C++ precompiler macros: https://stackoverflow.com/questions/17739390/different-format-of-date-macro

This has the benefits of:

The macro could be inserted directly into the editor files instead of separate header+cpp files, and only a utility function for converting the format would be needed (would probably need to be put in core).

CMake's configure_file can also be used, but has similar disadvantages to the current approach.

jkulawik commented 4 weeks ago

There's also buildcounterinput.txt files which are used in VS project files, not sure what to do with those. Although those project files definitely have to be regenerated anyway.

jkulawik commented 4 weeks ago

Split that to another issue, this one is done.