CMake has a
option for predefined build types. The build type affects
optimization and whether the result of the build is
debuggable. Those used by MySQL are
RelWithDebInfo(optimizations are on, debug info is generated) is used in MySQL by default.
Debug(optimizations are off, debug info is generated) is used if the
WITH_DEBUGoption is set.
CMAKE_BUILD_TYPEis not set when custom compile flags are used (see Section 18.104.22.168, “How to Specify Compilers and Compiler Flags”).