All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv4 04/16] package/flare-engine: disable effect of CMAKE_BUILD_TYPE
Date: Tue,  1 Jun 2021 16:34:09 +0200	[thread overview]
Message-ID: <20210601143422.25064-5-patrickdepinguin@gmail.com> (raw)
In-Reply-To: <20210601143422.25064-1-patrickdepinguin@gmail.com>

From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

flare-engine enables profiling when CMAKE_BUILD_TYPE is 'Debug'. The
Buildroot package explicitly avoided that by forcing CMAKE_BUILD_TYPE to
'RelWithDebInfo' when pkg-cmake.mk would normally set it to 'Debug'. Until
recently, this was the case when BR2_ENABLE_DEBUG was enabled.

A previous commit changed the condition under which CMAKE_BUILD_TYPE=Debug
was set, from BR2_ENABLE_DEBUG=y to BR2_ENABLE_RUNTIME_DEBUG=y, so logically
the flare-engine package would have to be updated accordingly.

However, apart from the profiling flag, the flare-engine package only uses
CMAKE_BUILD_TYPE to determine flags that Buildroot wants to control itself,
like optimization and debugging flags.

This means we can fake CMAKE_BUILD_TYPE to a value that has no meaning for
flare-engine itself, without needing to check BR2_ENABLE_DEBUG nor
BR2_ENABLE_RUNTIME_DEBUG.

Incidentally, this trick was already done in case
BR2_TOOLCHAIN_HAS_GCC_BUG_85180 was true, so move that line out of this
condition.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
v4:
- use a custom build type as suggested by Arnout.

 package/flare-engine/flare-engine.mk | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/package/flare-engine/flare-engine.mk b/package/flare-engine/flare-engine.mk
index e2f3eefa28..b91fc16af3 100644
--- a/package/flare-engine/flare-engine.mk
+++ b/package/flare-engine/flare-engine.mk
@@ -14,16 +14,12 @@ FLARE_ENGINE_DEPENDENCIES += sdl2 sdl2_image sdl2_mixer sdl2_ttf
 # Don't use /usr/games and /usr/share/games
 FLARE_ENGINE_CONF_OPTS += -DBINDIR=bin -DDATADIR=share/flare
 
-# Don't use the default Debug type as it adds -pg (gprof)
-ifeq ($(BR2_ENABLE_DEBUG),y)
-FLARE_ENGINE_CONF_OPTS += -DCMAKE_BUILD_TYPE=RelWithDebInfo
-endif
+# CMAKE_BUILD_TYPE is only used to set optimization and debug flags, all of
+# which we want Buildroot to steer explicitly. Explicitly set a fake build type
+# to get this control.
+FLARE_ENGINE_CONF_OPTS += -DCMAKE_BUILD_TYPE=Buildroot
 
 ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
-# CMakeLists.txt sets CMAKE_CXX_FLAGS_<BUILD_TYPE> depending on
-# BUILD_TYPE, and this comes after the generic CMAKE_CXX_FLAGS.
-# Override CMAKE_BUILD_TYPE so no overrides are applied.
-FLARE_ENGINE_CONF_OPTS += -DCMAKE_BUILD_TYPE=Buildroot
 FLARE_ENGINE_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -O0"
 endif
 
-- 
2.26.3

  parent reply	other threads:[~2021-06-01 14:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 14:34 [Buildroot] [PATCHv4 00/16] Introduce BR2_ENABLE_RUNTIME_DEBUG Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 01/16] core: introduce BR2_ENABLE_RUNTIME_DEBUG Thomas De Schampheleire
2021-06-01 20:32   ` Yann E. MORIN
2021-06-01 14:34 ` [Buildroot] [PATCHv4 02/16] core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set Thomas De Schampheleire
2021-06-01 20:36   ` Yann E. MORIN
2021-06-05 16:50     ` D. Olsson
2021-06-05 17:11       ` Thomas De Schampheleire
2021-07-04  9:15   ` Thomas Petazzoni
2021-07-04 11:01     ` Peter Korsgaard
2021-07-04 11:32       ` Yann E. MORIN
2021-07-04 12:09         ` Yann E. MORIN
2021-07-04 14:58     ` Arnout Vandecappelle
2021-07-04 19:52       ` Yann E. MORIN
2021-06-01 14:34 ` [Buildroot] [PATCHv4 03/16] package/pkg-cmake.mk: determine CMAKE_BUILD_TYPE depending on BR2_ENABLE_RUNTIME_DEBUG Thomas De Schampheleire
2021-06-01 20:37   ` Yann E. MORIN
2021-06-01 14:34 ` Thomas De Schampheleire [this message]
2021-06-01 14:34 ` [Buildroot] [PATCHv4 05/16] package/sysrepo: use default CMAKE_BUILD_TYPE for host package Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 06/16] package/sysrepo: remove explicit setting of CMAKE_BUILD_TYPE Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 07/16] package/boost: use BR2_ENABLE_RUNTIME_DEBUG iso BR2_ENABLE_DEBUG Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 08/16] package/oracle-mysql: " Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 09/16] package/qt5: " Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 10/16] package/ripgrep: " Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 11/16] package/sofia-sip: correct passing of '--enable-ndebug' Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 12/16] package/sofia-sip: don't set 'NDEBUG' explicitly Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 13/16] package/zmqpp: don't set CONFIG=debug Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 14/16] package/zmqpp: use BR2_ENABLE_RUNTIME_DEBUG iso BR2_ENABLE_DEBUG Thomas De Schampheleire
2021-06-01 14:34 ` [Buildroot] [PATCHv4 15/16] package/pkg-meson.mk: determine 'buildtype' based on " Thomas De Schampheleire
2021-06-01 20:30   ` Yann E. MORIN
2021-06-01 21:13     ` Arnout Vandecappelle
2021-06-01 14:34 ` [Buildroot] [PATCHv4 16/16] utils/genrandconfig: also test BR2_ENABLE_RUNTIME_DEBUG Thomas De Schampheleire
2021-06-01 20:54 ` [Buildroot] [PATCHv4 00/16] Introduce BR2_ENABLE_RUNTIME_DEBUG Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210601143422.25064-5-patrickdepinguin@gmail.com \
    --to=patrickdepinguin@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.