diff options
| author | ruki <[email protected]> | 2024-04-11 00:54:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-11 00:54:39 +0800 |
| commit | 56b62725e6e35fa9265f9f6251dae84dd6933df5 (patch) | |
| tree | 0fe1bdd692ff472251f511692393a9898e122ee7 | |
| parent | d6bcf3fb73418c99def14a8e2d0cb08bb75fecee (diff) | |
improve on_fetch
| -rw-r--r-- | xmake/core/package/package.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 6dcd0f40f..abad53326 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1730,11 +1730,14 @@ function _instance:_fetch_library(opt) opt = opt or {} local fetchinfo local on_fetch = self:script("fetch") - if on_fetch and (not opt.system or (opt.system and not self:is_cross())) then - fetchinfo = on_fetch(self, {force = opt.force, - system = opt.system, - external = opt.external, - require_version = opt.require_version}) + if on_fetch then + -- we cannot fetch it from system if it's cross-compilation package + if not opt.system or (opt.system and not self:is_cross()) then + fetchinfo = on_fetch(self, {force = opt.force, + system = opt.system, + external = opt.external, + require_version = opt.require_version}) + end if fetchinfo and opt.require_version and opt.require_version:find(".", 1, true) then local version = fetchinfo.version if not (version and (version == opt.require_version or semver.satisfies(version, opt.require_version))) then |
