From f34b7e35cc1c636ae9f3656b3deba0597435a726 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 16 Jul 2020 22:50:41 +0800 Subject: build lua-cjson --- core/src/lua-cjson/xmake.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 core/src/lua-cjson/xmake.lua (limited to 'core/src/lua-cjson/xmake.lua') diff --git a/core/src/lua-cjson/xmake.lua b/core/src/lua-cjson/xmake.lua new file mode 100644 index 000000000..76caf9fc7 --- /dev/null +++ b/core/src/lua-cjson/xmake.lua @@ -0,0 +1,15 @@ +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") + end + -- cgit v1.3.1 From 5c4e36e63a63742fc81910cce39a2fc54b36db05 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jul 2020 00:58:45 +0800 Subject: fix compile errors --- core/src/lua-cjson/xmake.lua | 3 --- 1 file changed, 3 deletions(-) (limited to 'core/src/lua-cjson/xmake.lua') diff --git a/core/src/lua-cjson/xmake.lua b/core/src/lua-cjson/xmake.lua index 76caf9fc7..9c93fb562 100644 --- a/core/src/lua-cjson/xmake.lua +++ b/core/src/lua-cjson/xmake.lua @@ -2,9 +2,6 @@ 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") -- cgit v1.3.1 From a586eb19b8e24e97cb41918f3e692f6fc7b35368 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jul 2020 22:33:46 +0800 Subject: fix link errors for msvc --- core/src/lua-cjson/xmake.lua | 3 +++ core/src/xmake/engine.c | 2 ++ 2 files changed, 5 insertions(+) (limited to 'core/src/lua-cjson/xmake.lua') diff --git a/core/src/lua-cjson/xmake.lua b/core/src/lua-cjson/xmake.lua index 9c93fb562..76caf9fc7 100644 --- a/core/src/lua-cjson/xmake.lua +++ b/core/src/lua-cjson/xmake.lua @@ -2,6 +2,9 @@ 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") diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index 337627047..fb6205ac5 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -225,7 +225,9 @@ tb_int_t xm_curses_register(lua_State* lua); #endif // open cjson +__tb_extern_c_enter__ tb_int_t luaopen_cjson(lua_State *l); +__tb_extern_c_leave__ /* ////////////////////////////////////////////////////////////////////////////////////// * globals -- cgit v1.3.1 From a9f65fda1e6fdf15d8e695308e39859141373503 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jul 2020 22:35:05 +0800 Subject: fix strncasecmp for cjson --- core/src/lua-cjson/xmake.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'core/src/lua-cjson/xmake.lua') diff --git a/core/src/lua-cjson/xmake.lua b/core/src/lua-cjson/xmake.lua index 76caf9fc7..1d7229aa2 100644 --- a/core/src/lua-cjson/xmake.lua +++ b/core/src/lua-cjson/xmake.lua @@ -11,5 +11,6 @@ target("lua-cjson") if is_plat("windows") then -- Windows sprintf()/strtod() handle NaN/inf differently. Not supported. add_defines("DISABLE_INVALID_NUMBERS") + add_defines("strncasecmp=_strnicmp") end -- cgit v1.3.1 From ebed90e5a6f358e375a8efd0c57c29f4dca59331 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jul 2020 22:38:41 +0800 Subject: fix compile errors for vs2013 --- core/src/lua-cjson/xmake.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'core/src/lua-cjson/xmake.lua') diff --git a/core/src/lua-cjson/xmake.lua b/core/src/lua-cjson/xmake.lua index 1d7229aa2..cdf3502a9 100644 --- a/core/src/lua-cjson/xmake.lua +++ b/core/src/lua-cjson/xmake.lua @@ -12,5 +12,6 @@ target("lua-cjson") -- Windows sprintf()/strtod() handle NaN/inf differently. Not supported. add_defines("DISABLE_INVALID_NUMBERS") add_defines("strncasecmp=_strnicmp") + add_defines("inline=__inline") end -- cgit v1.3.1 From 6b3cf4e5239f3f041501d0d8ee32471f33010708 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jul 2020 22:41:11 +0800 Subject: update lua-cjson --- core/src/lua-cjson/lua-cjson | 2 +- core/src/lua-cjson/xmake.lua | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'core/src/lua-cjson/xmake.lua') diff --git a/core/src/lua-cjson/lua-cjson b/core/src/lua-cjson/lua-cjson index ab5ec0ea2..ddd218d35 160000 --- a/core/src/lua-cjson/lua-cjson +++ b/core/src/lua-cjson/lua-cjson @@ -1 +1 @@ -Subproject commit ab5ec0ea2de2603bb01e6ea33f7e3197d431ec5a +Subproject commit ddd218d35f65a3e0a9f45de5e897f5c319ee4a82 diff --git a/core/src/lua-cjson/xmake.lua b/core/src/lua-cjson/xmake.lua index cdf3502a9..b25640cae 100644 --- a/core/src/lua-cjson/xmake.lua +++ b/core/src/lua-cjson/xmake.lua @@ -11,7 +11,6 @@ target("lua-cjson") if is_plat("windows") then -- Windows sprintf()/strtod() handle NaN/inf differently. Not supported. add_defines("DISABLE_INVALID_NUMBERS") - add_defines("strncasecmp=_strnicmp") add_defines("inline=__inline") end -- cgit v1.3.1