From: Samuel Martin <s.martin49@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v6 1/9] Revert "package/cmake: with BR2_ENABLE_DEBUG use RelWithDebInfo"
Date: Sun, 16 Oct 2016 13:12:37 +0200 [thread overview]
Message-ID: <20161016111245.1847-2-s.martin49@gmail.com> (raw)
In-Reply-To: <20161016111245.1847-1-s.martin49@gmail.com>
This reverts commit 4b0120183404913f7f7788ef4f0f6b51498ef363.
Before reverting this patch, CMake packages are built with the following
options:
* if BR2_ENABLE_DEBUG is set:
The CMake build type is set to RelWithDebInfo, which means:
- Optimization level is forced to: -O2;
- no log nor assert due to -DNDEBUG;
- BR2_DEBUG_{1..3} effect is unchanged;
* otherwise:
The CMake build type is set to Release, which means:
- Optimization level is forced to: -O3;
- no log nor assert due to -DNDEBUG (as expected).
In any case, the optimization WRT the binary size is always ignored
and forced.
Reverting to the previous situation, so Buildroot now chooses between
the 'Debug' and 'Release' config types, which are semantically closer
to what Buildroot does everywhere else:
* if BR2_ENABLE_DEBUG is set:
The CMake build type is set to Debug, which means:
- only -g option is passed by CMake;
- optimization is not forced, nor debug level, so they are kept
as-is;
* otherwise:
The CMake build type is set to Release, so no change in this case:
- Optimization level is forced to: -O3;
- no log nor assert due to -DNDEBUG (as expected);
- size optimization is ignored.
Follow-up patches will fix the CMake flag variables that are appended by
CMake.
Cc: Charles Hardin <ckhardin@exablox.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
changes v5->v6:
- revert 4b01201 instead (Arnout)
changes v4->v5:
- none
changes v3->v4:
- simplify build type selection
---
package/pkg-cmake.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index aca9e61..4883b3b 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -87,7 +87,7 @@ define $(2)_CONFIGURE_CMDS
PATH=$$(BR_PATH) \
$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
- -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),RelWithDebInfo,Release) \
+ -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),Debug,Release) \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_COLOR_MAKEFILE=OFF \
-DBUILD_DOC=OFF \
--
2.10.0
next prev parent reply other threads:[~2016-10-16 11:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-16 11:12 [Buildroot] [PATCH v6 0/9] Misc. CMake fixes Samuel Martin
2016-10-16 11:12 ` Samuel Martin [this message]
2016-10-16 18:53 ` [Buildroot] [PATCH v6 1/9] Revert "package/cmake: with BR2_ENABLE_DEBUG use RelWithDebInfo" Arnout Vandecappelle
2016-10-16 11:12 ` [Buildroot] [PATCH v6 2/9] package/pkg-cmake.mk: move CMAKE_BUILD_TYPE definition into toolchainfile.cmake Samuel Martin
2016-10-16 19:05 ` Arnout Vandecappelle
2016-10-22 14:43 ` Thomas Petazzoni
2016-10-16 11:12 ` [Buildroot] [PATCH v6 3/9] toolchainfile.cmake: set per-config appended {C, CXX}FLAGS Samuel Martin
2016-10-16 19:09 ` Arnout Vandecappelle
2016-10-22 14:43 ` Thomas Petazzoni
2016-10-16 11:12 ` [Buildroot] [PATCH v6 4/9] package/gflags: include TARGET_CXXFLAGS to the overloaded CXXFLAGS Samuel Martin
2016-10-16 11:12 ` [Buildroot] [PATCH v6 5/9] package/gnuradio: include TARGET_CFLAGS to the overloaded CFLAGS Samuel Martin
2016-10-16 11:12 ` [Buildroot] [PATCH v6 6/9] package/libcec: include TARGET_{C, CXX}FLAGS to the overloaded {C, CXX}FLAGS Samuel Martin
2016-10-16 11:12 ` [Buildroot] [PATCH v6 7/9] package/opencv3: fix CMAKE_CXX_FLAGS Samuel Martin
2016-10-16 11:12 ` [Buildroot] [PATCH v6 8/9] package/rpi-userland: include TARGET_CFLAGS to the overloaded CFLAGS Samuel Martin
2016-10-16 11:12 ` [Buildroot] [PATCH v6 9/9] toochainfile.cmake: rework the way Buildroot sets flags Samuel Martin
2016-10-16 19:13 ` Arnout Vandecappelle
2016-10-22 14:42 ` [Buildroot] [PATCH v6 0/9] Misc. CMake fixes Thomas Petazzoni
2016-10-22 15:09 ` Samuel Martin
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=20161016111245.1847-2-s.martin49@gmail.com \
--to=s.martin49@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox