Change CMake build types to Debug, ReleaseGeneric, and ReleaseNative
Closed this issue · 2 comments
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
- Intended for catching bugs when something is acting up, or for sanity-checking a new feature
- No optimizations
- No LTO
- All debugging options
- (optional) Address sanitizer if applicable
ReleaseDebug
- Intended for playing and testing during regular development
- Optimizations to make build fairly fast but can still be debugged (
-O1 -gequivalent) - No LTO
- Some debugging options
ReleaseGeneric
- Intended for distribution at project releases
- Full optimizations for generic build (
-O3equivalent, non-CPU-specific, no-march=native, etc.) - LTO
- No debugging options
ReleaseNative
- Intended for people compiling it themselves for max speed; this is relevant because of the software renderer
- Maximum optimizations for the machine it's compiling on (
-march=native,-Ofast, etc.) - LTO
- No debugging options
Might try revising this to just Debug, ReleaseGeneric, and ReleaseNative.