kumquat-buildroot/docs/manual
Thomas De Schampheleire 61c5e0319c package/pkg-cmake.mk: determine CMAKE_BUILD_TYPE depending on BR2_ENABLE_RUNTIME_DEBUG
The CMAKE_BUILD_TYPE is currently set as 'Debug' in case BR2_ENABLE_DEBUG is
set, and as 'Release' in other cases. However, while the description of
BR2_ENABLE_DEBUG is to enable debug symbols (no runtime impact), the 'Debug'
build type in CMake can actually have runtime impact. For one, because it
does not set -DNDEBUG like is done for 'Release', but also because packages
may do custom things based on it.

The question of which CMAKE_BUILD_TYPE Buildroot should set, be it 'Debug',
'Release', 'RelWithDebInfo' or others, has come up several times in the
past. See some references below:

- July 2016: switch from Debug to RelWithDebInfo:
  https://git.buildroot.org/buildroot/commit/?id=4b0120183404913f7f7788ef4f0f6b51498ef363

- October 2016: switch from RelWithDebInfo back to Debug:
  https://git.buildroot.org/buildroot/commit/?id=104bb29e0490bfb487e2e665448dd3ca07fcc2b5
  and changes to make sure Buildroot's flags are respected:
  https://git.buildroot.org/buildroot/commit/?id=12494ef48f893684d0800e7f6fe39a2ceaed0451

- August 2017: bug #10246 - "BR2_ENABLE_DEBUG does not have the expected
  effect for cmake packages"
  https://bugs.busybox.net/show_bug.cgi?id=10246

- August 2017: mail thread following bug #10246:
  http://lists.busybox.net/pipermail/buildroot/2017-August/200778.html

In the last mail thread, Samuel Martin confirmed that the 'Release' build
type could be used in all cases, because Buildroot is actually making sure
that the optimization flags are those determined by Buildroot, not the
defaults of cmake, thanks to commit 12494ef48f.
But Arnout Vandecappelle objected to using always 'Release', stating that
users may actually want the extra assertions.

With the introduction of BR2_ENABLE_RUNTIME_DEBUG, Buildroot can now cater
for all cases:

- use CMAKE_BUILD_TYPE=Release by default. This makes sure that there is no
  unexpected performance degradation triggered by enabling BR2_ENABLE_DEBUG.

- users can optionally enable BR2_ENABLE_RUNTIME_DEBUG if they want runtime
  debug info like assertions, at the risk of introducing performance
  degradation. In this case, we switch to CMAKE_BUILD_TYPE=Debug.

- orthogonally to the above, BR2_ENABLE_DEBUG still determines passing the
  '-g' flag to enable debug symbols, and BR2_OPTIMIZE_X still determines the
  used optimization flags.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-06-01 22:39:28 +02:00
..
adding-board-support.txt manual: board support: add more of our expectations 2020-09-02 23:47:57 +02:00
adding-packages-asciidoc.txt
adding-packages-autotools.txt
adding-packages-cargo.txt
adding-packages-cmake.txt package/pkg-cmake.mk: determine CMAKE_BUILD_TYPE depending on BR2_ENABLE_RUNTIME_DEBUG 2021-06-01 22:39:28 +02:00
adding-packages-conclusion.txt
adding-packages-directory.txt
adding-packages-generic.txt docs/manual: do not expose CPE_ID_VALID as package-settable 2021-03-06 17:05:59 +01:00
adding-packages-gettext.txt
adding-packages-golang.txt docs/manual/adding-packages-golang.txt: update following go.mod integration 2020-08-29 14:49:12 +02:00
adding-packages-hooks.txt
adding-packages-kconfig.txt
adding-packages-kernel-module.txt
adding-packages-linux-kernel-spec-infra.txt
adding-packages-luarocks.txt
adding-packages-meson.txt
adding-packages-perl.txt
adding-packages-python.txt
adding-packages-qmake.txt package/pkg-qmake: add <pkg>_SYNC_QT_HEADERS support 2020-12-05 22:48:47 +01:00
adding-packages-rebar.txt
adding-packages-tips.txt docs/manual: add documentation for the gitlab macro 2021-03-28 22:44:57 +02:00
adding-packages-virtual.txt
adding-packages-waf.txt
adding-packages.txt
advanced.txt
appendix.txt
beyond-buildroot.txt
ccache-support.txt
common-usage.txt docs/manual: add some minimal documentation about show-info and pkg-stats 2020-11-11 12:09:41 +01:00
configure-other-components.txt
configure.txt
contribute.txt docs/manual: Add section about contributing to maintenance branches 2020-09-09 00:38:41 +02:00
customize-configuration.txt
customize-device-permission-tables.txt
customize-directory-structure.txt
customize-outside-br.txt docs/manual: add section about br2-external init 2020-10-14 23:04:33 +02:00
customize-packages.txt
customize-patches.txt
customize-post-image.txt package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts 2021-05-06 22:58:54 +02:00
customize-quick-guide.txt
customize-rootfs.txt package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts 2021-05-06 22:58:54 +02:00
customize-users-tables.txt
customize.txt
debugging-buildroot.txt
developers.txt
download-infra.txt
download-location.txt
eclipse-integration.txt
faq-troubleshooting.txt
getting.txt
how-buildroot-works.txt
introduction.txt
known-issues.txt
legal-notice.txt
make-tips.txt
makedev-syntax.txt
makeusers-syntax.txt
manual.mk
manual.txt docs/manual: add a section about SELinux 2020-09-04 14:47:29 +02:00
migrating.txt
package-make-target.txt
patch-policy.txt
prerequisite.txt
quickstart.txt
rebuilding-packages.txt
release-engineering.txt
resources.txt
selinux-support.txt docs/manual: add a section about SELinux 2020-09-04 14:47:29 +02:00
using-buildroot-debugger.txt
using-buildroot-development.txt
using-buildroot-toolchain.txt package/environment-setup: fix spelling of the script file in the manual. 2021-01-07 23:09:47 +01:00
writing-rules.txt