All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Julien Olivain <ju.o@free.fr>
Cc: buildroot@buildroot.org, Gilles Talis <gilles.talis@gmail.com>
Subject: Re: [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: add Platform/Buildroot-Initialize.cmake
Date: Wed, 4 Feb 2026 10:13:12 +0100	[thread overview]
Message-ID: <aYMNm2HxiDuR1POR@windsurf> (raw)
In-Reply-To: <20260117103109.12198-1-ju.o@free.fr>

On Sat, Jan 17, 2026 at 11:31:09AM +0100, Julien Olivain via buildroot wrote:
> Since commit [1] (core/pkg-cmake: provide our own platform
> description), Buildroot is setting its own CMake platform
> description. This description applies minor changes on top of
> the CMake Linux platform, see [2] and [3]. The CMake system specific
> script tries to include an initialization script, if present.
> See [4].
> 
> Since in commit [1] we set the CMAKE_SYSTEM_NAME to "Buildroot"
> (rather than "Linux"), CMake will search for a
> "Platform/Buildroot-Initialize.cmake" which does not exist, and
> continue normally, since the include is optional.
> 
> The "Platform/Linux-Initialize.cmake" file is the one setting the
> LINUX [6] and UNIX [7] variables, which are expected to be true on
> a linux compatible system. In Buildroot, it is currently not
> included, so those variables are unset.
> 
> If a CMake package in Buildroot has a construct such as:
> 
>     if(LINUX)
>         # ...do things...
>     else()
>         message(FATAL_ERROR "System not supported")
>     endif()
> 
> It will fail at configuration time.
> 
> This situation happened when trying to add the btop++ package
> in Buildroot. See [8].
> 
> Since the initial intent of commit [1] was to make the Buildroot
> CMake system inherit from Linux plus some fixups, this commit simply
> adds a Buildroot-Initialize.cmake file that includes the
> Linux-Initialize.cmake one from CMake. This will have the effect
> to properly define the LINUX and UNIX variables.
> 
> [1] https://gitlab.com/buildroot.org/buildroot/-/commit/c69b14fe2f72d8134057b115884c04a2bf27d410
> [2] https://gitlab.com/buildroot.org/buildroot/-/blob/2025.11/support/misc/Buildroot.cmake#L1-4
> [3] https://cmake.org/cmake/help/v4.2/variable/CMAKE_SYSTEM_NAME.html
> [4] https://gitlab.kitware.com/cmake/cmake/-/blob/v4.2.1/Modules/CMakeSystemSpecificInitialize.cmake#L35
> [5] https://gitlab.kitware.com/cmake/cmake/-/blob/v4.2.1/Modules/Platform/Linux-Initialize.cmake
> [6] https://cmake.org/cmake/help/v4.2/variable/LINUX.html
> [7] https://cmake.org/cmake/help/v4.2/variable/UNIX.html
> [8] https://github.com/aristocratos/btop/blob/v1.4.6/CMakeLists.txt#L76
> 
> Reported-by: Gilles Talis <gilles.talis@gmail.com>
> Signed-off-by: Julien Olivain <ju.o@free.fr>

Applied, thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2026-02-04  9:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-17 10:31 [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: add Platform/Buildroot-Initialize.cmake Julien Olivain via buildroot
2026-01-22 17:21 ` Gilles Talis
2026-02-04  9:13 ` Thomas Petazzoni via buildroot [this message]

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=aYMNm2HxiDuR1POR@windsurf \
    --to=buildroot@buildroot.org \
    --cc=gilles.talis@gmail.com \
    --cc=ju.o@free.fr \
    --cc=thomas.petazzoni@bootlin.com \
    /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.