From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 1/8] package/pkg-cmake.mk: fix build type and optimization flags
Date: Sat, 15 Oct 2016 12:44:29 +0200 [thread overview]
Message-ID: <20161015124429.181dcdb8@free-electrons.com> (raw)
In-Reply-To: <CAHXCMM+1cbRY11V4cKHB=dCScSG7KGGraFz2NkWsWH+1tiG7XQ@mail.gmail.com>
Hello,
On Sat, 15 Oct 2016 12:34:29 +0200, Samuel Martin wrote:
> > Can't we tell CMake to not do all this crap, and simply not add
> > -g/-O<x> options by itself ?
>
> As discussed IRL, this solution is kind of the optimal one, not the
> best one but the one that is the closest to what BR is trying to do in
> all cases.
Just to expand on that, a few more details from our discussions:
- If we don't pass a CMAKE_BUILD_TYPE, then CMake doesn't pass any
compiler flags. This would be ideal, but unfortunately some packages
force their own build type in their CMakeLists.txt), and in this case
CMake passes its own compiler flags. Which would mean some packages
may always be built in debug mode, or always be built in release,
depending on what they have chosen in their CMakeLists.txt to be the
default, and this wouldn't be affected by the Buildroot
configuration.
Due to this, we *want* to force CMAKE_BUILD_TYPE, as it ensures all
CMake packages are built in a way that is as close as possible to
the selected Buildroot configuration.
- There is no way to tell CMake to not pass compiler flags and to
ignore the build type written in the CMakeLists.txt file. We could
patch CMake for that, but we are now using the system-provided cmake
when it's available, so we can hardly relying on cmake patching.
Bottom line: your patch is indeed the best we can do. It's not perfect,
but we can't easily do better.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-10-15 10:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-15 9:44 [Buildroot] [PATCH v3 0/8] Misc. CMake fixes Samuel Martin
2016-10-15 9:44 ` [Buildroot] [PATCH v3 1/8] package/pkg-cmake.mk: fix build type and optimization flags Samuel Martin
2016-10-15 10:25 ` Thomas Petazzoni
2016-10-15 10:34 ` Samuel Martin
2016-10-15 10:44 ` Thomas Petazzoni [this message]
2016-10-15 15:17 ` Arnout Vandecappelle
2016-10-15 9:44 ` [Buildroot] [PATCH v3 2/8] package/assimp: wrap long lines Samuel Martin
2016-10-15 10:26 ` Thomas Petazzoni
2016-10-15 9:44 ` [Buildroot] [PATCH v3 3/8] package/gflags: includes TARGET_CXXFLAGS to the overloaded CXXFLAGS Samuel Martin
2016-10-15 15:25 ` Arnout Vandecappelle
2016-10-15 9:44 ` [Buildroot] [PATCH v3 4/8] package/gnuradio: includes TARGET_CFLAGS to the overloaded CFLAGS Samuel Martin
2016-10-15 15:25 ` Arnout Vandecappelle
2016-10-15 9:44 ` [Buildroot] [PATCH v3 5/8] package/libcec: includes TARGET_{C, CXX}FLAGS to the overloaded {C, CXX}FLAGS Samuel Martin
2016-10-15 15:30 ` Arnout Vandecappelle
2016-10-15 9:44 ` [Buildroot] [PATCH v3 6/8] package/opencv3: fix CMAKE_CXX_FLAGS Samuel Martin
2016-10-15 15:35 ` Arnout Vandecappelle
2016-10-15 9:44 ` [Buildroot] [PATCH v3 7/8] package/rpi-userland: includes TARGET_CFLAGS to the overloaded CFLAGS Samuel Martin
2016-10-15 15:37 ` Arnout Vandecappelle
2016-10-15 9:44 ` [Buildroot] [PATCH v3 8/8] toochainfile.cmake: rework the way Buildroot sets flags Samuel Martin
2016-10-15 15:52 ` Arnout Vandecappelle
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=20161015124429.181dcdb8@free-electrons.com \
--to=thomas.petazzoni@free-electrons.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