All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OEToolchainConfig.cmake: Remove CMAKE_FIND_ROOT_PATH
@ 2021-05-11 21:36 Cristian Morales Vega
  2021-09-09  9:51 ` Cristian Morales Vega
  0 siblings, 1 reply; 2+ messages in thread
From: Cristian Morales Vega @ 2021-05-11 21:36 UTC (permalink / raw)
  To: openembedded-core; +Cc: Cristian Morales Vega

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] OEToolchainConfig.cmake: Remove CMAKE_FIND_ROOT_PATH
  2021-05-11 21:36 [PATCH] OEToolchainConfig.cmake: Remove CMAKE_FIND_ROOT_PATH Cristian Morales Vega
@ 2021-09-09  9:51 ` Cristian Morales Vega
  0 siblings, 0 replies; 2+ messages in thread
From: Cristian Morales Vega @ 2021-09-09  9:51 UTC (permalink / raw)
  To: openembedded-core

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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-09  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.