afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
988 stars 68 forks source link

Change CMake build types to Debug, ReleaseGeneric, and ReleaseNative #191

Closed afritz1 closed 3 years ago

afritz1 commented 3 years ago

This has been on my mind for a while. Basically in Visual Studio where I do all the development, I don't have a strong go-to build type. Debug is too slow, Release doesn't have enough debug info, and RelWithDebInfo feels like too much of a gray area. I have never really liked RelWithDebInfo and have never used MinSizeRel, so those two should be deleted from CMAKE_CONFIGURATION_TYPES altogether, along with Release.

The top-level CMakeLists.txt is most likely where all changes need to be made.

The new build types should at the minimum all work correctly with MSVC and Makefiles and apply to both the components and TESArena project targets. If there has to be a default or single build type, it should be ReleaseDebug.

Just realized that all of the GNU CMAKE_CXX_FLAGS lines in the top-level CMakeLists.txt are probably being applied to all build types; that might be one place to revisit by appending the new configuration names on the end instead.

There was recently a problem with Travis CI not liking the LTO option in the GCC build so there might need to be some extra configuring there, possibly by making Travis CI choose the Debug build.

Resources: https://stackoverflow.com/a/24470998 https://stackoverflow.com/a/24767451

Debug

ReleaseDebug

ReleaseGeneric

ReleaseNative

afritz1 commented 3 years ago

Might try revising this to just Debug, ReleaseGeneric, and ReleaseNative.

afritz1 commented 3 years ago

Fixed by #208.