Skip to content

Commit 6179b45

Browse files
drizthauke
authored andcommitted
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: openwrt/openwrt#16263 (cherry picked from commit 4646aa1) Link: openwrt/openwrt#19525 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent d06733b commit 6179b45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/cmake.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ ifeq ($(HOST_USE_NINJA),1)
6868
define Host/Uninstall/Default
6969
+$(NINJA) -C $(HOST_CMAKE_BINARY_DIR) uninstall
7070
endef
71+
else
72+
CMAKE_HOST_OPTIONS += -DCMAKE_GENERATOR="Unix Makefiles"
7173
endif
7274

7375
ifeq ($(PKG_USE_NINJA),1)
@@ -80,6 +82,8 @@ ifeq ($(PKG_USE_NINJA),1)
8082
define Build/Install/Default
8183
+DESTDIR="$(PKG_INSTALL_DIR)" $(NINJA) -C $(CMAKE_BINARY_DIR) install
8284
endef
85+
else
86+
CMAKE_OPTIONS += -DCMAKE_GENERATOR="Unix Makefiles"
8387
endif
8488

8589
define Build/Configure/Default

0 commit comments

Comments
 (0)