Skip to content

Commit

Permalink
ninja: add custom target support for ninja-cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Apr 22, 2021
1 parent 178f01d commit 0510aad
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
6 changes: 3 additions & 3 deletions devel/ninja/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=ninja
PKG_VERSION:=1.10.0
PKG_RELEASE:=1
PKG_VERSION:=1.10.2
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/ninja-build/ninja/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=3810318b08489435f8efc19c05525e80a993af5a55baa0dfeae0465a9d45f99f
PKG_HASH:=ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed

PKG_MAINTAINER:=Andre Heider <[email protected]>
PKG_LICENSE:=Apache-2.0
Expand Down
25 changes: 25 additions & 0 deletions devel/ninja/ninja-cmake.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
include $(INCLUDE_DIR)/cmake.mk
include ../../devel/ninja/ninja.mk

CMAKE_HOST_OPTIONS += -DCMAKE_GENERATOR="Ninja"
CMAKE_OPTIONS += -DCMAKE_GENERATOR="Ninja"

define Host/Compile/Default
$(call Ninja,-C $(HOST_BUILD_DIR)/$(CMAKE_BINARY_SUBDIR) $(1),)
endef

define Host/Install/Default
$(call Ninja,-C $(HOST_BUILD_DIR)/$(CMAKE_BINARY_SUBDIR) install,)
endef

define Host/Uninstall/Default
-$(call Ninja,-C $(HOST_BUILD_DIR)/$(CMAKE_BINARY_SUBDIR) uninstall,)
endef

define Build/Compile/Default
$(call Ninja,-C $(PKG_BUILD_DIR)/$(CMAKE_BINARY_SUBDIR) $(1),)
endef

define Build/Install/Default
$(call Ninja,-C $(PKG_BUILD_DIR)/$(CMAKE_BINARY_SUBDIR) install,DESTDIR="$(PKG_INSTALL_DIR)")
endef
3 changes: 3 additions & 0 deletions devel/ninja/ninja.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# $(call Ninja,-C $(MY_NINJA_BUILD_DIR),$(MY_NINJA_ENV_VARS))
# endef

HOST_BUILD_DEPENDS += ninja/host
PKG_BUILD_DEPENDS += ninja/host

NINJA_ARGS:=$(filter -j%,$(filter-out -j,$(MAKEFLAGS)))
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
NINJA_ARGS+=-v
Expand Down

0 comments on commit 0510aad

Please sign in to comment.