summaryrefslogtreecommitdiff
path: root/tests/projects/other/native_module/cjson/modules/lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-25 00:54:13 +0800
committerruki <[email protected]>2024-07-25 00:54:13 +0800
commitc7c412f6458f5aceeb02e9bfc292dc7aac0852d3 (patch)
tree90fc1076e7dd5a2971d7033bee28825a80e59477 /tests/projects/other/native_module/cjson/modules/lua
parent039cd576af844dc146b7517160648765b90b81b1 (diff)
move autogen tests
Diffstat (limited to 'tests/projects/other/native_module/cjson/modules/lua')
-rw-r--r--tests/projects/other/native_module/cjson/modules/lua/cjson/src/cjson.c7
-rw-r--r--tests/projects/other/native_module/cjson/modules/lua/cjson/xmake.lua19
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/projects/other/native_module/cjson/modules/lua/cjson/src/cjson.c b/tests/projects/other/native_module/cjson/modules/lua/cjson/src/cjson.c
new file mode 100644
index 000000000..d8c2e49ef
--- /dev/null
+++ b/tests/projects/other/native_module/cjson/modules/lua/cjson/src/cjson.c
@@ -0,0 +1,7 @@
+#include <xmi.h>
+
+int luaopen_cjson(lua_State* lua);
+
+int luaopen(cjson, lua_State* lua) {
+ return luaopen_cjson(lua);
+}
diff --git a/tests/projects/other/native_module/cjson/modules/lua/cjson/xmake.lua b/tests/projects/other/native_module/cjson/modules/lua/cjson/xmake.lua
new file mode 100644
index 000000000..434746541
--- /dev/null
+++ b/tests/projects/other/native_module/cjson/modules/lua/cjson/xmake.lua
@@ -0,0 +1,19 @@
+add_rules("mode.debug", "mode.release")
+
+target("cjson")
+ add_rules("module.shared")
+ set_warnings("all")
+ if is_plat("windows") then
+ set_languages("c89")
+ end
+ add_files("src/*.c")
+ add_files("../../../../../../../core/src/lua-cjson/lua-cjson/*.c|fpconv.c")
+ -- Use internal strtod() / g_fmt() code for performance and disable multi-thread
+ add_defines("NDEBUG", "USE_INTERNAL_FPCONV")
+ add_defines("XM_CONFIG_API_HAVE_LUA_CJSON")
+ if is_plat("windows") then
+ -- Windows sprintf()/strtod() handle NaN/inf differently. Not supported.
+ add_defines("DISABLE_INVALID_NUMBERS")
+ add_defines("inline=__inline")
+ end
+