Skip to content

Commit

Permalink
build: fix CMake generator for non-Ninja builds
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: openwrt/openwrt#16263
Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
drizt authored and hauke committed Aug 29, 2024
1 parent dd1bfbe commit 4646aa1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/cmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 4646aa1

Please sign in to comment.