1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-19 23:28:39 +02:00
openwrt-packages/lang/lua-cjson/Makefile
Rosen Penev a31b732007 treewide: build CMake projects with Ninja
faster to compile.

A small selection of packages was tested going from:

Executed in  696.30 secs   fish           external
   usr time   82.98 mins  395.00 micros   82.98 mins
   sys time    9.02 mins    0.00 micros    9.02 mins

to:

Executed in  592.20 secs   fish           external
   usr time   84.84 mins  361.00 micros   84.84 mins
   sys time    8.85 mins   57.00 micros    8.85 mins

Tested by running make -j 12 and wiping staging/build_dir/target_x

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-03-27 21:51:50 -07:00

56 lines
1.3 KiB
Makefile

#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=lua-cjson
PKG_VERSION:=2.1.0
PKG_RELEASE:=2
PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.kyne.com.au/~mark/software/download/
PKG_HASH:=51bc69cd55931e0cba2ceae39e9efa2483f4292da3a88a1ed470eda829f6c778
HOST_BUILD_DEPENDS:=lua/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
include ../../devel/ninja/ninja-cmake.mk
define Package/lua-cjson
SUBMENU:=Lua
SECTION:=lang
CATEGORY:=Languages
TITLE:=Lua CJSON parser
URL:=https://github.com/mpx/lua-cjson
DEPENDS:= +lua
endef
define Package/lua-cjson/description
Lua CJSON is a fast JSON encoding/parsing module for Lua.
endef
CMAKE_OPTIONS += \
-DUSE_LUA=ON
CMAKE_HOST_OPTIONS += \
-DLUA_MATH_LIBRARY=m
define Package/lua-cjson/install
$(INSTALL_DIR) $(1)/usr/lib/lua
$(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/lib/lua/
$(INSTALL_DIR) $(1)/usr/lib/lua/cjson
$(INSTALL_DATA) $(PKG_BUILD_DIR)/lua/cjson/util.lua $(1)/usr/lib/lua/cjson
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,lua-cjson))