Home

RelWithDebInfo

RelWithDebInfo, short for Release with Debug Information, is a common build configuration used by CMake and other build systems. It represents a middle ground between Debug and Release, aiming to provide optimized code while retaining debugging symbols. This configuration is often chosen for distribution builds where performance matters but some debugging capability is still needed.

In practice, RelWithDebInfo enables compiler optimizations similar to Release, while including a reasonable amount of debugging

Usage typically involves selecting RelWithDebInfo as the build type. In CMake, you can request it with cmake

information.
The
exact
compiler
flags
depend
on
the
toolchain,
but
the
goal
is
to
produce
binaries
that
run
fast
like
Release
builds
and
can
be
symbolicated
for
debugging
without
requiring
a
full
Debug
build.
As
a
result,
binaries
built
with
RelWithDebInfo
are
generally
smaller
and
faster
than
Debug
builds,
and
include
enough
symbols
to
diagnose
issues
such
as
crashes
or
performance
problems.
However,
they
may
not
expose
every
internal
check
or
variable
that
a
pure
Debug
build
would,
and
the
symbol
footprint
is
larger
than
Release
but
smaller
than
Debug.
-DCMAKE_BUILD_TYPE=RelWithDebInfo
..
For
multi-config
generators
such
as
Visual
Studio,
the
configuration
is
chosen
in
the
IDE
or
via
command
line
per
configuration;
debugging
symbol
packaging
for
releases
may
still
be
handled
via
separate
symbol
packages
in
some
distributions.
RelWithDebInfo
is
a
standard
option
across
platforms
and
toolchains,
intended
for
production-like
builds
that
retain
debuggability.