All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/pkg-meson: add cmake dependency support
@ 2022-03-24  5:56 James Hilliard
  2022-03-27 16:23 ` Arnout Vandecappelle
  2022-03-31 11:24 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: James Hilliard @ 2022-03-24  5:56 UTC (permalink / raw)
  To: buildroot; +Cc: Eric Le Bihan, James Hilliard

Meson dependencies and variables can be provided by cmake similar to
how they can be provided by pkgconfig, for this to work we need to
ensure that cmake_prefix_path is set for both cross and native
targets along with the cmake binary path.

See:
https://mesonbuild.com/Dependencies.html#cmake
https://mesonbuild.com/Dependencies.html#arbitrary-variables-from-dependencies-that-can-be-found-multiple-ways
https://mesonbuild.com/Machine-files.html#meson-builtin-options

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 package/pkg-meson.mk                   | 2 ++
 support/misc/cross-compilation.conf.in | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 85de98e03a..9e70d49b60 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -79,6 +79,7 @@ define PKG_MESON_CROSSCONFIG_SED
         -e "s%@TARGET_CFLAGS@%$(call make-sq-comma-list,$($(strip $(1))))%g" \
         -e "s%@TARGET_LDFLAGS@%$(call make-sq-comma-list,$($(strip $(3))))%g" \
         -e "s%@TARGET_CXXFLAGS@%$(call make-sq-comma-list,$($(strip $(2))))%g" \
+        -e "s%@BR2_CMAKE@%$(BR2_CMAKE)%g" \
         -e "s%@PKGCONF_HOST_BINARY@%$(HOST_DIR)/bin/pkgconf%g" \
         -e "s%@STAGING_DIR@%$(STAGING_DIR)%g" \
         -e "s%@STATIC@%$(if $(BR2_STATIC_LIBS),true,false)%g" \
@@ -136,6 +137,7 @@ define $(2)_CONFIGURE_CMDS
 		-Db_pie=false \
 		-Dstrip=false \
 		-Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \
+		-Dbuild.cmake_prefix_path=$$(HOST_DIR)/lib/cmake \
 		$$($$(PKG)_CONF_OPTS) \
 		$$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
 endef
diff --git a/support/misc/cross-compilation.conf.in b/support/misc/cross-compilation.conf.in
index 18cf258a8e..1977a83501 100644
--- a/support/misc/cross-compilation.conf.in
+++ b/support/misc/cross-compilation.conf.in
@@ -8,6 +8,7 @@ c = '@TARGET_CC@'
 cpp = '@TARGET_CXX@'
 ar = '@TARGET_AR@'
 strip = '@TARGET_STRIP@'
+cmake = '@BR2_CMAKE@'
 pkgconfig = '@PKGCONF_HOST_BINARY@'
 g-ir-compiler = '@STAGING_DIR@/usr/bin/g-ir-compiler'
 g-ir-scanner = '@STAGING_DIR@/usr/bin/g-ir-scanner'
@@ -18,6 +19,7 @@ c_link_args = [@TARGET_LDFLAGS@]
 cpp_args = [@TARGET_CXXFLAGS@]
 cpp_link_args = [@TARGET_LDFLAGS@]
 wrap_mode = 'nodownload'
+cmake_prefix_path = '@STAGING_DIR@/usr/lib/cmake'
 
 [properties]
 needs_exe_wrapper = true
-- 
2.25.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-meson: add cmake dependency support
  2022-03-24  5:56 [Buildroot] [PATCH 1/1] package/pkg-meson: add cmake dependency support James Hilliard
@ 2022-03-27 16:23 ` Arnout Vandecappelle
  2022-03-31 11:24 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-03-27 16:23 UTC (permalink / raw)
  To: James Hilliard, buildroot; +Cc: Eric Le Bihan



On 24/03/2022 06:56, James Hilliard wrote:
> Meson dependencies and variables can be provided by cmake similar to
> how they can be provided by pkgconfig, for this to work we need to
> ensure that cmake_prefix_path is set for both cross and native
> targets along with the cmake binary path.
> 
> See:
> https://mesonbuild.com/Dependencies.html#cmake
> https://mesonbuild.com/Dependencies.html#arbitrary-variables-from-dependencies-that-can-be-found-multiple-ways
> https://mesonbuild.com/Machine-files.html#meson-builtin-options
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   package/pkg-meson.mk                   | 2 ++
>   support/misc/cross-compilation.conf.in | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> index 85de98e03a..9e70d49b60 100644
> --- a/package/pkg-meson.mk
> +++ b/package/pkg-meson.mk
> @@ -79,6 +79,7 @@ define PKG_MESON_CROSSCONFIG_SED
>           -e "s%@TARGET_CFLAGS@%$(call make-sq-comma-list,$($(strip $(1))))%g" \
>           -e "s%@TARGET_LDFLAGS@%$(call make-sq-comma-list,$($(strip $(3))))%g" \
>           -e "s%@TARGET_CXXFLAGS@%$(call make-sq-comma-list,$($(strip $(2))))%g" \
> +        -e "s%@BR2_CMAKE@%$(BR2_CMAKE)%g" \
>           -e "s%@PKGCONF_HOST_BINARY@%$(HOST_DIR)/bin/pkgconf%g" \
>           -e "s%@STAGING_DIR@%$(STAGING_DIR)%g" \
>           -e "s%@STATIC@%$(if $(BR2_STATIC_LIBS),true,false)%g" \
> @@ -136,6 +137,7 @@ define $(2)_CONFIGURE_CMDS
>   		-Db_pie=false \
>   		-Dstrip=false \
>   		-Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \
> +		-Dbuild.cmake_prefix_path=$$(HOST_DIR)/lib/cmake \
>   		$$($$(PKG)_CONF_OPTS) \
>   		$$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
>   endef
> diff --git a/support/misc/cross-compilation.conf.in b/support/misc/cross-compilation.conf.in
> index 18cf258a8e..1977a83501 100644
> --- a/support/misc/cross-compilation.conf.in
> +++ b/support/misc/cross-compilation.conf.in
> @@ -8,6 +8,7 @@ c = '@TARGET_CC@'
>   cpp = '@TARGET_CXX@'
>   ar = '@TARGET_AR@'
>   strip = '@TARGET_STRIP@'
> +cmake = '@BR2_CMAKE@'
>   pkgconfig = '@PKGCONF_HOST_BINARY@'
>   g-ir-compiler = '@STAGING_DIR@/usr/bin/g-ir-compiler'
>   g-ir-scanner = '@STAGING_DIR@/usr/bin/g-ir-scanner'
> @@ -18,6 +19,7 @@ c_link_args = [@TARGET_LDFLAGS@]
>   cpp_args = [@TARGET_CXXFLAGS@]
>   cpp_link_args = [@TARGET_LDFLAGS@]
>   wrap_mode = 'nodownload'
> +cmake_prefix_path = '@STAGING_DIR@/usr/lib/cmake'
>   
>   [properties]
>   needs_exe_wrapper = true
_______________________________________________
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-meson: add cmake dependency support
  2022-03-24  5:56 [Buildroot] [PATCH 1/1] package/pkg-meson: add cmake dependency support James Hilliard
  2022-03-27 16:23 ` Arnout Vandecappelle
@ 2022-03-31 11:24 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-03-31 11:24 UTC (permalink / raw)
  To: James Hilliard; +Cc: Eric Le Bihan, buildroot

>>>>> "James" == James Hilliard <james.hilliard1@gmail.com> writes:

 > Meson dependencies and variables can be provided by cmake similar to
 > how they can be provided by pkgconfig, for this to work we need to
 > ensure that cmake_prefix_path is set for both cross and native
 > targets along with the cmake binary path.

 > See:
 > https://mesonbuild.com/Dependencies.html#cmake
 > https://mesonbuild.com/Dependencies.html#arbitrary-variables-from-dependencies-that-can-be-found-multiple-ways
 > https://mesonbuild.com/Machine-files.html#meson-builtin-options

 > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

Committed to 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
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-03-31 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24  5:56 [Buildroot] [PATCH 1/1] package/pkg-meson: add cmake dependency support James Hilliard
2022-03-27 16:23 ` Arnout Vandecappelle
2022-03-31 11:24 ` Peter Korsgaard

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.