Skip to content

Ring Racers CMake + Debug build improvements

Sal requested to merge cmake-rr-ports into next

General CMake improvements:

  • Added configure presets:
    • "default": Build a Release build using the Ninja generator, with Debug symbols exported to their own file.
    • "debug": Build a Debug build using the Ninja generator.
  • Added some git aliases for running CMake quickly.
  • EXE naming improvements:
    • If SRB2_SDL2_EXE_NAME is left blank, it now uses a default name by appending the branch name as a suffix. (For instance, building this branch on Windows will call the EXE srb2win_cmake-rr-ports.exe.) No branch suffix is added for the master branch.
    • Added SRB2_SDL2_EXE_SUFFIX, which adds an extra suffix to the end of the EXE name.
  • Sources are back in CMakeLists.txt. (The sourcefile method was not able to update the CMake cache.)
  • Always build GME, regardless of system library option.
    • GME compiles with a really slow YM2612 emulator on Linux by default, so always compiling means we can enforce something faster.
  • Disable dynamic base on Windows.
    • Fixes crash reports on Windows CMake builds.
  • Split the dependency scripts into their own files.
  • Exported additional version information to the game:
    • What kind of build type the compile is.
    • Whenever or not the compile has uncommitted changes.
    • Whenever or not the compile has optimizations enabled.
    • Branch is now able to determine detached HEAD.
    • Commit hash is separated from commit summary.
    • Most of this stuff is unused right now. Ring Racers uses all of this stuff for debug build title screen, but I decided against porting this part currently as this branch is already chunky enough.

Debugging improvements:

  • Added -nofork command line parameter to disable SDL forked signal handler.
    • This allows for GDB to consistently attach to the correct process.
  • Added assert console command.
    • This prints whenever or not this build has assertions enabled.
  • Fixed PARANOIA builds.
    • Removed a few faulty asserts that made these builds unusable.
    • Fixed SCRAMBLE_REMOVED doing the mobj scramble in the middle of removing an object instead of at the very end.
    • Replaced the unknown thinker I_Error with an assert.
    • Made PARANOIA's mobj reference checks more useful:
      • The existing warning no longer spams the console every tic.
      • The existing warning now prints mobj address, mobj type, and reference count.
      • P_SetTarget, when it causes a reference to go negative, now prints mobj address, mobj type, thinker function, reference count, and source code line number.
    • Compiling Debug builds now always enables everything that SRB2_CONFIG_DEBUGMODE also enables. (PARANOIA, RANGECHECK, ZDEBUG, and PACKETDROP)

Additionally, add a deprecation warning when using the Makefile.

Edited by Sal

Merge request reports