Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 2/2] toolchainfile.cmake: rework the Buildroot flags addition
Date: Mon, 3 Oct 2016 23:18:09 +0200	[thread overview]
Message-ID: <20161003231809.1b84ec79@free-electrons.com> (raw)
In-Reply-To: <20161001163314.10173-2-s.martin49@gmail.com>

Hello,

On Sat,  1 Oct 2016 18:33:14 +0200, Samuel Martin wrote:

> Thus, due to these CMake specifics, the implementation should take care
> of a couple of things:
> - keeping the per-package customization of the standard CMake flags;
> - making sure the Buildroot's flags are added into the standard CMake
>   flags;
> - avoid introducing duplicates in resulting CMake flags.
> 
> So, this change introduces an helper in the toolchainfile.cmake file
> that will extend the standard CMake flags variables with the flags
> defined by Buildroot only when they are not already present (i.e. only
> the first time the toolchain file is processed by CMake when configuring
> a project).
> Then, this helper is used to extend any standard CMake flags variables.

This looks very complicated. What about not passing those
CFLAGS/CXXFLAGS at all from the toolchain file?

After all, for other packages (generic-package or autotools-package),
we are currently:

 * Passing some of the CFLAGS/CXXFLAGS hardcoded into the wrapper. This
   also applies and works well for CMake packages.

 * Passing some of the CFLAGS/CXXFLAGS in the environment, when
   configuring/building. There is no reason why this shouldn't be done
   for CMake as well.

So what about giving up on passing TARGET_CFLAGS/TARGET_CXXFLAGS in the
CMake toolchain file, and instead pass them explicitly when configuring
CMake, in the <pkg>_CONFIGURE_CMDS of pkg-cmake.mk.

Would this solve the problem without this awfully complicated CMake
toolchain file?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-10-03 21:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01 16:33 [Buildroot] [PATCH v2 1/2] DEVELOPERS: update my entry list Samuel Martin
2016-10-01 16:33 ` [Buildroot] [PATCH v2 2/2] toolchainfile.cmake: rework the Buildroot flags addition Samuel Martin
2016-10-03 21:18   ` Thomas Petazzoni [this message]
2016-10-04 21:12     ` Arnout Vandecappelle
2016-10-03 21:19 ` [Buildroot] [PATCH v2 1/2] DEVELOPERS: update my entry list Thomas Petazzoni

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=20161003231809.1b84ec79@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