diff options
| -rw-r--r-- | xmake/core/package/package.lua | 16 |
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() |
