summaryrefslogtreecommitdiff
path: root/xmake/modules/private/action/require/impl/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-06-25 22:42:55 +0800
committerruki <[email protected]>2021-06-25 22:42:55 +0800
commite90da39112c300c003cc9482acfcec7f28e85efc (patch)
treee47d4afd373ae07d54daa9d95b8b5e1a750c24a5 /xmake/modules/private/action/require/impl/package.lua
parentcfdd992044c10dce5c181a3b61e38021926c399a (diff)
install precompiled artifacts
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
-rw-r--r--xmake/modules/private/action/require/impl/package.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index e3fa7e3af..d66686482 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -78,6 +78,7 @@ end
-- true: only get system package
-- false: only get remote packages
--
+-- {build = true}: always build packages, we do not use the precompiled artifacts
--
function _parse_require(require_str)
@@ -173,7 +174,8 @@ function _load_require(require_str, requires_extra, parentinfo)
optional = parentinfo.optional or require_extra.optional, -- default: false, inherit parentinfo.optional
verify = require_extra.verify, -- default: true, we can set false to ignore sha256sum and select any version
external = require_extra.external, -- default: true, we use sysincludedirs/-isystem instead of -I/xxx
- private = require_extra.private -- default: false, private package, only for installation, do not export any links/includes and environments
+ private = require_extra.private, -- default: false, private package, only for installation, do not export any links/includes and environments
+ build = require_extra.build -- default: false, always build packages, we do not use the precompiled artifacts
}
return required.packagename, required.requireinfo
end
@@ -544,8 +546,12 @@ function _load_package(packagename, requireinfo, opt)
end
-- load package from repositories
+ local from_repo = false
if not package then
package = _load_package_from_repository(packagename, requireinfo.reponame)
+ if package then
+ from_repo = true
+ end
end
-- load package from system
@@ -616,6 +622,18 @@ function _load_package(packagename, requireinfo, opt)
-- check package configurations
_check_package_configurations(package)
+ -- save artifacts info, we need add it at last before buildhash need depend on package configurations
+ if from_repo and not option.get("build") and not requireinfo.build then
+ local artifacts_manifest = repository.artifacts_manifest(packagename, version)
+ if artifacts_manifest then
+ local buildid = package:plat() .. "-" .. package:arch() .. "-" .. package:buildhash()
+ local artifacts_info = artifacts_manifest[buildid]
+ if artifacts_info then
+ package:artifacts_set(artifacts_info)
+ end
+ end
+ end
+
-- do load
local on_load = package:script("load")
if on_load then