summaryrefslogtreecommitdiff
path: root/core/src/lua-cjson
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/lua-cjson')
m---------core/src/lua-cjson/lua-cjson0
-rw-r--r--core/src/lua-cjson/makefile30
-rw-r--r--core/src/lua-cjson/xmake.lua16
3 files changed, 46 insertions, 0 deletions
diff --git a/core/src/lua-cjson/lua-cjson b/core/src/lua-cjson/lua-cjson
new file mode 160000
+Subproject ddd218d35f65a3e0a9f45de5e897f5c319ee4a8
diff --git a/core/src/lua-cjson/makefile b/core/src/lua-cjson/makefile
new file mode 100644
index 000000000..0a4263f03
--- /dev/null
+++ b/core/src/lua-cjson/makefile
@@ -0,0 +1,30 @@
+# prefix
+include $(PRO_DIR)/prefix.mak
+
+# module name
+NAMES = lua-cjson
+
+# module type
+lua-cjson_TYPE = LIB
+
+# config
+lua-cjson_CONFIG = n
+
+# core files
+lua-cjson_C_FILES += \
+ lua-cjson/dtoa \
+ lua-cjson/g_fmt \
+ lua-cjson/strbuf \
+ lua-cjson/lua_cjson
+
+# cflags
+# Use internal strtod() / g_fmt() code for performance and disable multi-thread
+lua-cjson_CFLAGS += -DNDEBUG -DUSE_INTERNAL_FPCONV
+
+# includes
+lua-cjson_INC_DIRS += \
+ ../luajit/luajit/src
+
+# suffix
+include $(PRO_DIR)/suffix.mak
+
diff --git a/core/src/lua-cjson/xmake.lua b/core/src/lua-cjson/xmake.lua
new file mode 100644
index 000000000..b25640cae
--- /dev/null
+++ b/core/src/lua-cjson/xmake.lua
@@ -0,0 +1,16 @@
+target("lua-cjson")
+ set_kind("static")
+ set_warnings("all")
+ add_deps("luajit")
+ if is_plat("windows") then
+ set_languages("c89")
+ end
+ add_files("lua-cjson/*.c|fpconv.c")
+ -- Use internal strtod() / g_fmt() code for performance and disable multi-thread
+ add_defines("NDEBUG", "USE_INTERNAL_FPCONV")
+ if is_plat("windows") then
+ -- Windows sprintf()/strtod() handle NaN/inf differently. Not supported.
+ add_defines("DISABLE_INVALID_NUMBERS")
+ add_defines("inline=__inline")
+ end
+