Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/3] pkg-cmake: add option to select the Ninja generator
@ 2023-02-24 11:15 Thomas Devoogdt
  2023-02-24 11:15 ` [Buildroot] [PATCH v1 2/3] package/webkitgtk: use the CMAKE_NINJA flag Thomas Devoogdt
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Thomas Devoogdt @ 2023-02-24 11:15 UTC (permalink / raw)
  To: buildroot; +Cc: Adrian Perez de Castro, Samuel Martin, Thomas Devoogdt

E.g. Commit 
 16e5c92ff5fd2b44a1126bd7d7538c68ce838213, and
 78d499409f71d8a22b0632c8ebc06f67ee6ae6dd 
can now be replaced by: WEBKITGTK_CMAKE_NINJA = YES

Packages that are selecting Ninja, should also use the NINJA_{ENV,OPTS} variables iso the MAKE variables.

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
---
 package/pkg-cmake.mk | 41 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 8c375779cb..4ce3e6bada 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -65,6 +65,13 @@ else
 $(2)_BUILDDIR			= $$($(2)_SRCDIR)/buildroot-build
 endif
 
+ifeq ($$($(3)_CMAKE_NINJA),YES)
+$(2)_DEPENDENCIES += host-ninja
+$(2)_GENERATOR			= "Ninja"
+else
+$(2)_GENERATOR			= "Unix Makefiles"
+endif
+
 #
 # Configure step. Only define it if not already defined by the package
 # .mk file. And take care of the differences between host and target
@@ -88,7 +95,7 @@ define $(2)_CONFIGURE_CMDS
 	rm -f CMakeCache.txt && \
 	PATH=$$(BR_PATH) \
 	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
-		-G"Unix Makefiles" \
+		-G$$($$(PKG)_GENERATOR) \
 		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_INSTALL_RUNSTATEDIR="/run" \
@@ -119,7 +126,7 @@ define $(2)_CONFIGURE_CMDS
 	PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
 	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
 	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
-		-G"Unix Makefiles" \
+		-G$$($$(PKG)_GENERATOR) \
 		-DCMAKE_INSTALL_SO_NO_EXE=0 \
 		-DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
 		-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
@@ -165,45 +172,75 @@ $(2)_DEPENDENCIES += $(BR2_CMAKE_HOST_DEPENDENCY)
 #
 ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
+ifeq ($$($(3)_CMAKE_NINJA),YES)
+define $(2)_BUILD_CMDS
+	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
+endef
+else
 define $(2)_BUILD_CMDS
 	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR)
 endef
+endif
+else
+ifeq ($$($(3)_CMAKE_NINJA),YES)
+define $(2)_BUILD_CMDS
+	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
+endef
 else
 define $(2)_BUILD_CMDS
 	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR)
 endef
 endif
 endif
+endif
 
 #
 # Host installation step. Only define it if not already defined by the
 # package .mk file.
 #
 ifndef $(2)_INSTALL_CMDS
+ifeq ($$($(3)_CMAKE_NINJA),YES)
+define $(2)_INSTALL_CMDS
+	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) $$($$(PKG)_INSTALL_OPTS)
+endef
+else
 define $(2)_INSTALL_CMDS
 	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) $$($$(PKG)_INSTALL_OPTS) -C $$($$(PKG)_BUILDDIR)
 endef
 endif
+endif
 
 #
 # Staging installation step. Only define it if not already defined by
 # the package .mk file.
 #
 ifndef $(2)_INSTALL_STAGING_CMDS
+ifeq ($$($(3)_CMAKE_NINJA),YES)
+define $(2)_INSTALL_STAGING_CMDS
+	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR install
+endef
+else
 define $(2)_INSTALL_STAGING_CMDS
 	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) $$($$(PKG)_INSTALL_STAGING_OPTS) -C $$($$(PKG)_BUILDDIR)
 endef
 endif
+endif
 
 #
 # Target installation step. Only define it if not already defined by
 # the package .mk file.
 #
 ifndef $(2)_INSTALL_TARGET_CMDS
+ifeq ($$($(3)_CMAKE_NINJA),YES)
+define $(2)_INSTALL_TARGET_CMDS
+	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
+endef
+else
 define $(2)_INSTALL_TARGET_CMDS
 	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) $$($$(PKG)_INSTALL_TARGET_OPTS) -C $$($$(PKG)_BUILDDIR)
 endef
 endif
+endif
 
 # Call the generic package infrastructure to generate the necessary
 # make targets
-- 
2.39.2

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

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

end of thread, other threads:[~2023-03-13 18:48 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-24 11:15 [Buildroot] [PATCH v1 1/3] pkg-cmake: add option to select the Ninja generator Thomas Devoogdt
2023-02-24 11:15 ` [Buildroot] [PATCH v1 2/3] package/webkitgtk: use the CMAKE_NINJA flag Thomas Devoogdt
2023-02-24 11:15 ` [Buildroot] [PATCH v1 3/3] package/wpewebkit: " Thomas Devoogdt
2023-02-27 10:39   ` [Buildroot] [PATCH v2 1/3] pkg-cmake: add option to select the Ninja generator Thomas Devoogdt
2023-02-27 10:39     ` [Buildroot] [PATCH v2 2/3] package/webkitgtk: use the CMAKE_NINJA flag Thomas Devoogdt
2023-02-27 10:39     ` [Buildroot] [PATCH v2 3/3] package/wpewebkit: " Thomas Devoogdt
2023-02-28 15:33     ` [Buildroot] [PATCH v2 1/3] pkg-cmake: add option to select the Ninja generator John Keeping
2023-02-28 15:55       ` [Buildroot] [PATCH v3 " Thomas Devoogdt
2023-02-28 15:55         ` [Buildroot] [PATCH v3 2/3] package/webkitgtk: use the CMAKE_NINJA flag Thomas Devoogdt
2023-02-28 15:55         ` [Buildroot] [PATCH v3 3/3] package/wpewebkit: " Thomas Devoogdt
2023-03-03 12:15         ` [Buildroot] [PATCH v3 1/3] pkg-cmake: add option to select the Ninja generator John Keeping
2023-03-06 11:02         ` Arnout Vandecappelle
2023-03-07 16:10           ` Thomas Devoogdt
2023-03-13  6:55             ` [Buildroot] [PATCH v4 " Thomas Devoogdt
2023-03-13  6:55               ` [Buildroot] [PATCH v4 2/3] package/webkitgtk: use the CMAKE_NINJA flag Thomas Devoogdt
2023-03-13  6:55               ` [Buildroot] [PATCH v4 3/3] package/wpewebkit: " Thomas Devoogdt
2023-03-13 18:48               ` [Buildroot] [PATCH v4 1/3] pkg-cmake: add option to select the Ninja generator John Keeping
2023-02-24 17:53 ` [Buildroot] [PATCH v1 " John Keeping
2023-02-24 18:12   ` Thomas Devoogdt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox