diff options
| author | ruki <[email protected]> | 2022-03-21 23:06:35 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-03-21 23:06:35 +0800 |
| commit | e538f1f2db00e497e61ede972f406855f8d9e13b (patch) | |
| tree | 6e4fe9eb591c341fda9e32b79446c8c78637b0f4 /core/src/lua/xmake.lua | |
| parent | 91eaf2fb94584daf5a38dbed6876877f7743f56a (diff) | |
improve xmake.lua for core
Diffstat (limited to 'core/src/lua/xmake.lua')
| -rw-r--r-- | core/src/lua/xmake.lua | 13 |
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) |
