summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-21 23:06:35 +0800
committerruki <[email protected]>2022-03-21 23:06:35 +0800
commite538f1f2db00e497e61ede972f406855f8d9e13b (patch)
tree6e4fe9eb591c341fda9e32b79446c8c78637b0f4
parent91eaf2fb94584daf5a38dbed6876877f7743f56a (diff)
improve xmake.lua for core
-rw-r--r--core/src/lcurses/xmake.lua5
-rw-r--r--core/src/lua/xmake.lua13
-rw-r--r--xmake/modules/package/tools/cmake.lua2
3 files changed, 18 insertions, 2 deletions
diff --git a/core/src/lcurses/xmake.lua b/core/src/lcurses/xmake.lua
index d01058c56..d97d90d4f 100644
--- a/core/src/lcurses/xmake.lua
+++ b/core/src/lcurses/xmake.lua
@@ -16,3 +16,8 @@ target("lcurses")
else
add_options("curses")
end
+
+ -- suppress error: ld: archive has no table of contents file liblcurses.a
+ if is_plat("iphoneos") then
+ add_arflags("-s", {force = true})
+ end
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)
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 39f1e25f8..b5b47ced2 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -628,7 +628,7 @@ function _install_for_msvc(package, configs, opt)
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
local runenvs = _get_msvc_runenvs(package)
local msbuild = assert(find_tool("msbuild", {envs = runenvs}), "msbuild not found!")
- os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild",
+ os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "/nr:false",
(jobs ~= nil and format("-m:%d", jobs) or "-m"),
"-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"),
"-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})