summaryrefslogtreecommitdiff
path: root/core/src/lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/lua')
-rw-r--r--core/src/lua/xmake.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/src/lua/xmake.lua b/core/src/lua/xmake.lua
index 379bdc46a..5d08083db 100644
--- a/core/src/lua/xmake.lua
+++ b/core/src/lua/xmake.lua
@@ -17,7 +17,10 @@ target("lua")
add_includedirs("lua", {public = true})
-- add the common source files
- add_files("lua/*.c|lua.c|onelua.c")
+ add_files("lua/*.c|lua.c|onelua.c|loslib.c")
+ if not is_plat("iphoneos") then
+ add_files("lua/loslib.c")
+ end
-- add defines
add_defines("LUA_COMPAT_5_1", "LUA_COMPAT_5_2", "LUA_COMPAT_5_3", {public = true})
@@ -29,3 +32,11 @@ target("lua")
add_defines("LUA_USE_LINUX")
end
+ -- we just disable os.execute for ios, because os.execv do not use it
+ -- @see https://github.com/xmake-io/xmake/issues/2187
+ on_load("iphoneos", function (target)
+ local loslib_file = target:autogenfile("loslib.c")
+ os.cp(path.join(os.scriptdir(), "lua", "loslib.c"), loslib_file)
+ io.replace(loslib_file, "system(cmd)", "0", {plain = true})
+ target:add("files", loslib_file)
+ end)