title: What are CMAKE_BUILD_TYPE: Debug, Release, RelWithDebInfo and MinSizeRel?
body: <p>From the <a href="https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html" rel="noreferrer">docs page</a>:</p>
  <blockquote>
  <p><strong>CMAKE_BUILD_TYPE</strong></p>
  <p>Specifies the build type on single-configuration generators.</p>
  <p>This statically specifies what build type (configuration) will be built in this build tree. Possible values are empty, <code>Debug</code>, <code>Release</code>, <code>RelWithDebInfo</code> and <code>MinSizeRel</code>. This variable is only meaningful to single-configuration generators (such as <code>Makefile Generators</code> and <code>Ninja</code>) i.e. those which choose a single configuration when CMake runs to generate a build tree as opposed to multi-configuration generators which offer selection of the build configuration within the generated build environment. There are many per-config properties and variables (usually following clean <code>SOME_VAR_&lt;CONFIG&gt;</code> order conventions), such as <code>CMAKE_C_FLAGS_&lt;CONFIG&gt;</code>, specified as uppercase: <code>CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]</code>. For example, in a build tree configured to build type <code>Debug</code>, CMake will see to having <code>CMAKE_C_FLAGS_DEBUG</code> settings get added to the <code>CMAKE_C_FLAGS</code> settings. See also <code>CMAKE_CONFIGURATION_TYPES</code>.</p>
  </blockquote>
  <p>I'm aware the differences between <code>Debug</code> builds and <code>Release</code> builds, but what are the differences between <code>Release</code>, <code>RelWithDebInfo</code> and <code>MinSizeRel</code>? I'm guessing <code>RelWithDebInfo</code> meant creating debuggable binaries, and <code>MinSizeRel</code> meant creating smallest possible size binaries.</p>
  <p>From the <a href="https://llvm.org/docs/CMake.html#frequently-used-cmake-variables" rel="noreferrer">LLVM CMake page</a>:</p>
  <blockquote>
  <p><strong>CMAKE_BUILD_TYPE:STRING</strong></p>
  <p>If you are using an IDE such as Visual Studio, you should use the IDE settings to set the build type. Be aware that Release and RelWithDebInfo use different optimization levels on most platforms.</p>
  </blockquote>
  <p>If I want to generate a production build, should I choose <code>Release</code>?</p>