geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
223 stars 235 forks source link

Separate the tri-state CMAKE_BUILD_TYPE into two bi-state variables. #5809

Closed bangerth closed 4 months ago

bangerth commented 4 months ago

We have a lot of code of the form

if (cmake build type == DebugRelease)
  do this
  do that
elseif (cmake build type == Debug)
  do this
elseif (cmake build type == Release)
  do that
endif()

This is repetitive and cumbersome, and also invites mistakes. This patch splits the build type into two variables that each say whether debug build is ON/OFF and release build is ON/OFF. I find the resulting code much easier to read; it also reduces duplication.