summaryrefslogtreecommitdiff
path: root/core/src/lua-cjson
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/lua-cjson')
-rw-r--r--core/src/lua-cjson/makefile10
-rw-r--r--core/src/lua-cjson/xmake.lua2
2 files changed, 9 insertions, 3 deletions
diff --git a/core/src/lua-cjson/makefile b/core/src/lua-cjson/makefile
index 9e96851ae..e1d53ecf9 100644
--- a/core/src/lua-cjson/makefile
+++ b/core/src/lua-cjson/makefile
@@ -22,8 +22,14 @@ lua-cjson_C_FILES += \
lua-cjson_CFLAGS += -DNDEBUG -DUSE_INTERNAL_FPCONV
# includes
-lua-cjson_INC_DIRS += \
- ../luajit/luajit/src
+ifeq ($(BACKEND),luajit)
+lua-cjson_INC_DIRS += ../luajit/luajit/src
+lua-cjson_CXFLAGS += -DUSE_LUAJIT
+endif
+ifeq ($(BACKEND),lua)
+lua-cjson_INC_DIRS += ../lua/lua
+lua-cjson_CXFLAGS += -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2
+endif
# use given system library?
lua-cjson_C_FILES := $(if $(findstring cjson,$(base_LIBNAMES)),,$(lua-cjson_C_FILES))
diff --git a/core/src/lua-cjson/xmake.lua b/core/src/lua-cjson/xmake.lua
index d2eec99f0..d3b12ded1 100644
--- a/core/src/lua-cjson/xmake.lua
+++ b/core/src/lua-cjson/xmake.lua
@@ -1,7 +1,7 @@
target("lua-cjson")
set_kind("static")
set_warnings("all")
- add_deps("luajit")
+ add_deps(get_config("backend"))
if is_plat("windows") then
set_languages("c89")
end