Closed A2va closed 1 month ago
@waruqi
I started working on using the install
function with optional installdir
and libdir
.
But I'm confronted with a problem when changing arch, I thought of using something like:
local targets = _get_targets(...)
for _, arch in ipairs({"armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"}) do
if abi_filters[arch] then
options["arch"] = arch
task.run("config", options)
end
end
But since _get_targets
calls project.target
or project.ordertargets
, the targets are loaded there.
So when running the config task it says project and targets may have been loaded early!
Do you have any idea to find a way around it ?
please do not run config task. gradle will call config task
Yes I know, but how to change arch without running the config task ? The install function install the target (and the deps) only for current arch.
I think, I have found a solution.
import("private.action.require.register", {alias = "register_packages"})
local targets = _get_targets(...)
for _, arch in ipairs({"armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"}) do
if abi_filters[arch] then
config.set("arch", arch)
register_packages()
end
end
What do you think ?
maybe we can split it to gradle task for each arch.
We can add xmakeInstallForArmv7
, xmakeInstallForXXX
tasks to install so for each arch in xmakeInstall
task.
like build task:
then modify install_artifacts.lua to only install single arch library.
Yes, that's exactly what I was thinking when I looked at the code.
Thanks, I will test it in these days.
I have fixed it.
I noticed that the target packages were not installed, like other so file, so I added that. In addition, apart from the target file, no files are deleted in the
_clean_artifacts
function (cxx stl, ...).