[openwrt/openwrt] build: fix CMake generator for non-Ninja builds
LEDE Commits
lede-commits at lists.infradead.org
Thu Aug 29 10:48:00 PDT 2024
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4646aa169986036772b9f75393c08508d20ddf8b
commit 4646aa169986036772b9f75393c08508d20ddf8b
Author: Ivan Romanov <drizt72 at zoho.eu>
AuthorDate: Mon Aug 26 12:45:38 2024 +0500
build: fix CMake generator for non-Ninja builds
OpenWRT by default uses the Ninja generator, but some packages disable
Ninja and use the default Unix Makefiles generator. This generator can
be overridden in the user environment with `CMAKE_GENERATOR`. This patch
explicitly sets the correct generator when `PKG_USE_NINJA:=0`.
In particular, the `mt76` package uses the Makefiles generator.
Signed-off-by: Ivan Romanov <drizt72 at zoho.eu>
Link: https://github.com/openwrt/openwrt/pull/16263
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
include/cmake.mk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/cmake.mk b/include/cmake.mk
index c82ba5f809..00ade7fd7d 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -68,6 +68,8 @@ ifeq ($(HOST_USE_NINJA),1)
define Host/Uninstall/Default
+$(NINJA) -C $(HOST_CMAKE_BINARY_DIR) uninstall
endef
+else
+ CMAKE_HOST_OPTIONS += -DCMAKE_GENERATOR="Unix Makefiles"
endif
ifeq ($(PKG_USE_NINJA),1)
@@ -80,6 +82,8 @@ ifeq ($(PKG_USE_NINJA),1)
define Build/Install/Default
+DESTDIR="$(PKG_INSTALL_DIR)" $(NINJA) -C $(CMAKE_BINARY_DIR) install
endef
+else
+ CMAKE_OPTIONS += -DCMAKE_GENERATOR="Unix Makefiles"
endif
define Build/Configure/Default
More information about the lede-commits
mailing list