summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Romanov2024-08-26 07:45:38 +0000
committerHauke Mehrtens2025-07-27 17:53:03 +0000
commit6179b450fb0bd2e3b9e11fc467263da43bc9a703 (patch)
treea293a574dfd45008e7f1ec82c1517c68e619c714
parentd06733b5990ed2ba9ee30c3394fdda0fa9aa09bd (diff)
downloadopenwrt-6179b450fb0bd2e3b9e11fc467263da43bc9a703.tar.gz
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@zoho.eu> Link: https://github.com/openwrt/openwrt/pull/16263 (cherry picked from commit 4646aa169986036772b9f75393c08508d20ddf8b) Link: https://github.com/openwrt/openwrt/pull/19525 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--include/cmake.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/cmake.mk b/include/cmake.mk
index 9b169b0693..278d6e29e0 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