All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: unset CMAKE_GENERATOR vars
@ 2022-10-29 11:09 Gleb Mazovetskiy
  2022-10-30 16:48 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Gleb Mazovetskiy @ 2022-10-29 11:09 UTC (permalink / raw)
  To: buildroot; +Cc: Gleb Mazovetskiy, Samuel Martin

If the user environment defines `CMAKE_GENERATOR` (e.g.
`CMAKE_GENERATOR=Ninja`), buildroot would previously fail to build cmake
packages because buildroot uses `make` explicitly (as opposed to
`cmake --build`).

Unsets all the `CMAKE_GENERATOR*` variables before configuring a cmake
package.

Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
---
 package/pkg-cmake.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 081960b5bf..96b2579cc5 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -86,6 +86,7 @@ define $(2)_CONFIGURE_CMDS
 	(mkdir -p $$($$(PKG)_BUILDDIR) && \
 	cd $$($$(PKG)_BUILDDIR) && \
 	rm -f CMakeCache.txt && \
+	unset CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET CMAKE_GENERATOR_INSTANCE && \
 	PATH=$$(BR_PATH) \
 	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
 		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
@@ -111,6 +112,7 @@ define $(2)_CONFIGURE_CMDS
 	(mkdir -p $$($$(PKG)_BUILDDIR) && \
 	cd $$($$(PKG)_BUILDDIR) && \
 	rm -f CMakeCache.txt && \
+	unset CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET CMAKE_GENERATOR_INSTANCE && \
 	PATH=$$(BR_PATH) \
 	PKG_CONFIG="$$(PKG_CONFIG_HOST_BINARY)" \
 	PKG_CONFIG_SYSROOT_DIR="/" \
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: unset CMAKE_GENERATOR vars
  2022-10-29 11:09 [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: unset CMAKE_GENERATOR vars Gleb Mazovetskiy
@ 2022-10-30 16:48 ` Yann E. MORIN
  2022-11-01 16:36   ` Gleb Mazovetskiy
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2022-10-30 16:48 UTC (permalink / raw)
  To: Gleb Mazovetskiy; +Cc: Samuel Martin, buildroot

Gleb, All,

On 2022-10-29 12:09 +0100, Gleb Mazovetskiy spake thusly:
> If the user environment defines `CMAKE_GENERATOR` (e.g.
> `CMAKE_GENERATOR=Ninja`), buildroot would previously fail to build cmake
> packages because buildroot uses `make` explicitly (as opposed to
> `cmake --build`).
> 
> Unsets all the `CMAKE_GENERATOR*` variables before configuring a cmake
> package.
> 
> Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
> ---
>  package/pkg-cmake.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 081960b5bf..96b2579cc5 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -86,6 +86,7 @@ define $(2)_CONFIGURE_CMDS
>  	(mkdir -p $$($$(PKG)_BUILDDIR) && \
>  	cd $$($$(PKG)_BUILDDIR) && \
>  	rm -f CMakeCache.txt && \
> +	unset CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET CMAKE_GENERATOR_INSTANCE && \

I've instead applied the patch from Woody:
    https://patchwork.ozlabs.org/project/buildroot/patch/94745932ea2dfa030e3d438d7cf6b84f1ef2f69c.camel@carnegierobotics.com/

So I dropped your patch.

In the future, we should be able to replace the hard-coded "Unix
Makefiles" with a per-package setting, where package can elect building
built with nother backend (or better yet, switch netirely to another
backend globally), and the patch from Woody felt like slightly preparing
for that future.

Regards,
Yann E. MORIN.

>  	PATH=$$(BR_PATH) \
>  	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
>  		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
> @@ -111,6 +112,7 @@ define $(2)_CONFIGURE_CMDS
>  	(mkdir -p $$($$(PKG)_BUILDDIR) && \
>  	cd $$($$(PKG)_BUILDDIR) && \
>  	rm -f CMakeCache.txt && \
> +	unset CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET CMAKE_GENERATOR_INSTANCE && \
>  	PATH=$$(BR_PATH) \
>  	PKG_CONFIG="$$(PKG_CONFIG_HOST_BINARY)" \
>  	PKG_CONFIG_SYSROOT_DIR="/" \
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: unset CMAKE_GENERATOR vars
  2022-10-30 16:48 ` Yann E. MORIN
@ 2022-11-01 16:36   ` Gleb Mazovetskiy
  0 siblings, 0 replies; 3+ messages in thread
From: Gleb Mazovetskiy @ 2022-11-01 16:36 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Samuel Martin, buildroot


[-- Attachment #1.1: Type: text/plain, Size: 3170 bytes --]

Thanks!
Can we do something similar for `PERL_MM_OPT`?

Buildroot currently requires the user to unset it manually but ideally it'd
just unset it itself
https://github.com/buildroot/buildroot/blob/ba2659401feb5cc97cad501ab8b38268de578d3f/support/dependencies/dependencies.sh#L49-L56

On Sun, Oct 30, 2022 at 4:48 PM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

> Gleb, All,
>
> On 2022-10-29 12:09 +0100, Gleb Mazovetskiy spake thusly:
> > If the user environment defines `CMAKE_GENERATOR` (e.g.
> > `CMAKE_GENERATOR=Ninja`), buildroot would previously fail to build cmake
> > packages because buildroot uses `make` explicitly (as opposed to
> > `cmake --build`).
> >
> > Unsets all the `CMAKE_GENERATOR*` variables before configuring a cmake
> > package.
> >
> > Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
> > ---
> >  package/pkg-cmake.mk | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> > index 081960b5bf..96b2579cc5 100644
> > --- a/package/pkg-cmake.mk
> > +++ b/package/pkg-cmake.mk
> > @@ -86,6 +86,7 @@ define $(2)_CONFIGURE_CMDS
> >       (mkdir -p $$($$(PKG)_BUILDDIR) && \
> >       cd $$($$(PKG)_BUILDDIR) && \
> >       rm -f CMakeCache.txt && \
> > +     unset CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM
> CMAKE_GENERATOR_TOOLSET CMAKE_GENERATOR_INSTANCE && \
>
> I've instead applied the patch from Woody:
>
> https://patchwork.ozlabs.org/project/buildroot/patch/94745932ea2dfa030e3d438d7cf6b84f1ef2f69c.camel@carnegierobotics.com/
>
> So I dropped your patch.
>
> In the future, we should be able to replace the hard-coded "Unix
> Makefiles" with a per-package setting, where package can elect building
> built with nother backend (or better yet, switch netirely to another
> backend globally), and the patch from Woody felt like slightly preparing
> for that future.
>
> Regards,
> Yann E. MORIN.
>
> >       PATH=$$(BR_PATH) \
> >       $$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
> >
>  -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
> > @@ -111,6 +112,7 @@ define $(2)_CONFIGURE_CMDS
> >       (mkdir -p $$($$(PKG)_BUILDDIR) && \
> >       cd $$($$(PKG)_BUILDDIR) && \
> >       rm -f CMakeCache.txt && \
> > +     unset CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM
> CMAKE_GENERATOR_TOOLSET CMAKE_GENERATOR_INSTANCE && \
> >       PATH=$$(BR_PATH) \
> >       PKG_CONFIG="$$(PKG_CONFIG_HOST_BINARY)" \
> >       PKG_CONFIG_SYSROOT_DIR="/" \
> > --
> > 2.34.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>      |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is
> no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>  conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
>

[-- Attachment #1.2: Type: text/html, Size: 5014 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-11-01 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 11:09 [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: unset CMAKE_GENERATOR vars Gleb Mazovetskiy
2022-10-30 16:48 ` Yann E. MORIN
2022-11-01 16:36   ` Gleb Mazovetskiy

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.