summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-12 22:16:53 +0800
committerGitHub <[email protected]>2021-12-12 22:16:53 +0800
commit5c4adb14e1f45b40bb3d90a9459386f67f08c15f (patch)
tree9071d6d614bce985a5753e0229c64f7762484401
parentcece2f0114454da39d785ada3c7e1566e65a2018 (diff)
Update package.lua
-rw-r--r--xmake/core/package/package.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 5da349187..3b778d617 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -110,6 +110,9 @@ end
-- get the platform of package
function _instance:plat()
+ if self._PLAT then
+ return self._PLAT
+ end
-- @note we uses os.host() instead of them for the binary package
if self:is_binary() then
return os.subhost()
@@ -123,6 +126,9 @@ end
-- get the architecture of package
function _instance:arch()
+ if self._ARCH then
+ return self._ARCH
+ end
-- @note we uses os.arch() instead of them for the binary package
if self:is_binary() then
return os.subarch()
@@ -130,6 +136,16 @@ function _instance:arch()
return self:targetarch()
end
+-- set the package platform
+function _instance:plat_set(plat)
+ self._PLAT = plat
+end
+
+-- set the package architecture
+function _instance:arch_set(arch)
+ self._ARCH = arch
+end
+
-- get the target os
function _instance:targetos()
local requireinfo = self:requireinfo()