All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cristian Morales Vega" <christian.morales.vega@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] OEToolchainConfig.cmake: Remove CMAKE_FIND_ROOT_PATH
Date: Thu, 9 Sep 2021 10:51:30 +0100	[thread overview]
Message-ID: <CAOWQn3SME-Z-8eS7JMMfKDji+Wcxc4uiNxjTOVtxy6GxqOfg_w@mail.gmail.com> (raw)
In-Reply-To: <20210511213618.188369-1-christian.morales.vega@gmail.com>

Any feedback?

At the very least it should be
list( APPEND CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} )
to avoid ignoring user input.

In general the file could use some love:

> set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )

Why? cmake already reads CFLAGS from the environment and toolchain
files are supposed to use CMAKE_C_FLAGS_INIT anyway.

> set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS}  CACHE STRING "" FORCE )

Same.

> set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )

I wonder why this is needed, and CMAKE_ASM_FLAGS_INIT.

> set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE )

This isn't even a real cmake variable. If any package depends on it
it's broken and it should be patched.
The actual variables would be CMAKE_EXE_LINKER_FLAGS_INIT,
CMAKE_MODULE_LINKER_FLAGS_INIT and CMAKE_SHARED_LINKER_FLAGS_INIT.


On Tue, 11 May 2021 at 22:36, Cristian Morales Vega
<christian.morales.vega@gmail.com> wrote:
>
> Since cb42802f2fe CMAKE_SYSROOT has been set, making
> CMAKE_FIND_ROOT_PATH unnecessary.
> It also overwrites any CMAKE_FIND_ROOT_PATH the user may have provided,
> which is wrong.
> ---
> I am using this file because I received it as part of a Yocto SDK. I
> have never used OpenEmbedded, I guess this can potentially break
> something. Test before merging.
>
>  meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> index 8f6f3a272d..4403f8aa9c 100644
> --- a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> +++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> @@ -5,7 +5,6 @@ set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
>  set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE )
>  set( CMAKE_SYSROOT $ENV{OECORE_TARGET_SYSROOT} )
>
> -set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} )
>  set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
>  set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
>  set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
> --
> 2.31.1
>

      reply	other threads:[~2021-09-09  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 21:36 [PATCH] OEToolchainConfig.cmake: Remove CMAKE_FIND_ROOT_PATH Cristian Morales Vega
2021-09-09  9:51 ` Cristian Morales Vega [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=CAOWQn3SME-Z-8eS7JMMfKDji+Wcxc4uiNxjTOVtxy6GxqOfg_w@mail.gmail.com \
    --to=christian.morales.vega@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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.