You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on_install("cross", "linux", "macosx", "windows", "android", "bsd", function(package)local sourcedir = os.isdir("src") and "src/" or "" -- for tar.gz or git source
io.writefile("xmake.lua", format([[
local sourcedir ="%s"
includes("/xxx/xxx/xxx/*.lua")
set_toolchains("my_toolchain")
target("lualib")
set_kind("static")
set_basename("lua")
add_headerfiles(sourcedir .. "*.h", {prefixdir = "lua"})
add_files(sourcedir .. "*.c|lua.c|luac.c|onelua.c")
add_defines("LUA_COMPAT_5_2", "LUA_COMPAT_5_1")
if is_plat("cross", "linux", "bsd") then
add_defines("LUA_USE_LINUX")
add_defines("LUA_DL_DLOPEN")
elseif is_plat("macosx") then
add_defines("LUA_USE_MACOSX")
add_defines("LUA_DL_DYLD")
elseif is_plat("windows") then
-- Lua already detects Windows and sets according defines
if is_kind("shared") then
add_defines("LUA_BUILD_AS_DLL", {public = true})
end
end
target("lua")
set_kind("binary")
add_files(sourcedir .. "lua.c")
add_deps("lualib")
if not is_plat("windows") then
add_syslinks("dl")
end
...
The text was updated successfully, but these errors were encountered:
以lua这个包为例,是通过内置动态生成的一段编译脚本进行编译的。
如果用户自定义了toolchain 脚本,那么该脚本路径也需要透传到内置脚本里面,否则只是透传了toolchain的话,会提示找不到。
如果自定义toolchain脚本路径也透传了,下面的两行就无需添加了:
lua脚本片段如下:
The text was updated successfully, but these errors were encountered: