[Buildroot] [PATCH RFC 1/2] package/ninja: do not require cmake
Adrian Perez de Castro
aperez at igalia.com
Wed Jan 12 13:26:17 UTC 2022
Use host-generic-package to manually build ninja. This avoids the need
for host-cmake in preparation for the CMake build system machinery being
changed to use ninja instead of make.
Signed-off-by: Adrian Perez de Castro <aperez at igalia.com>
---
package/ninja/ninja.mk | 36 +++++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/package/ninja/ninja.mk b/package/ninja/ninja.mk
index ab1941023e..ae3be6a14f 100644
--- a/package/ninja/ninja.mk
+++ b/package/ninja/ninja.mk
@@ -9,8 +9,42 @@ NINJA_SITE = $(call github,ninja-build,ninja,v$(NINJA_VERSION))
NINJA_LICENSE = Apache-2.0
NINJA_LICENSE_FILES = COPYING
+# Ninja is used by CMake-based packages, avoid a circular dependency by
+# by using host-generic-package instead and using a single command to
+# compile the binary. This does in essence the same as the "bootstrap.py"
+# included in the distribution avoiding the need for host-python.
+define HOST_NINJA_BUILD_CMDS
+ cd $(@D) && $(HOSTCXX) $(HOST_CXXFLAGS) $(HOST_LDFLAGS) \
+ src/build_log.cc \
+ src/build.cc \
+ src/clean.cc \
+ src/clparser.cc \
+ src/dyndep.cc \
+ src/dyndep_parser.cc \
+ src/debug_flags.cc \
+ src/deps_log.cc \
+ src/disk_interface.cc \
+ src/edit_distance.cc \
+ src/eval_env.cc \
+ src/graph.cc \
+ src/graphviz.cc \
+ src/line_printer.cc \
+ src/manifest_parser.cc \
+ src/metrics.cc \
+ src/parser.cc \
+ src/state.cc \
+ src/string_piece_util.cc \
+ src/util.cc \
+ src/version.cc \
+ src/depfile_parser.cc \
+ src/lexer.cc \
+ src/subprocess-posix.cc \
+ src/ninja.cc \
+ -o ninja
+endef
+
define HOST_NINJA_INSTALL_CMDS
$(INSTALL) -m 0755 -D $(@D)/ninja $(HOST_DIR)/bin/ninja
endef
-$(eval $(host-cmake-package))
+$(eval $(host-generic-package))
--
2.34.1
More information about the buildroot
mailing list