summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-03 00:57:04 +0800
committerruki <[email protected]>2024-04-03 00:57:04 +0800
commitefbf92709a0be6e2fba38efe3e10a2684d4e3836 (patch)
treed135001bc3f1fbeb0887a05058b7aa7a45d5211d /xmake
parent1cb62a5d466173ce4e8690eb320c44d5ddd6e1e2 (diff)
add xmake.arch
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/_xmake_main.lua1
-rw-r--r--xmake/core/base/xmake.lua5
-rw-r--r--xmake/core/sandbox/modules/xmake.lua1
3 files changed, 7 insertions, 0 deletions
diff --git a/xmake/core/_xmake_main.lua b/xmake/core/_xmake_main.lua
index 6dba86db5..38f7df73d 100644
--- a/xmake/core/_xmake_main.lua
+++ b/xmake/core/_xmake_main.lua
@@ -26,6 +26,7 @@ xmake._HOST = _HOST
xmake._ARCH = _ARCH
xmake._SUBHOST = _SUBHOST
xmake._SUBARCH = _SUBARCH
+xmake._XMAKE_ARCH = _XMAKE_ARCH
xmake._VERSION = _VERSION
xmake._VERSION_SHORT = _VERSION_SHORT
xmake._PROGRAM_DIR = _PROGRAM_DIR
diff --git a/xmake/core/base/xmake.lua b/xmake/core/base/xmake.lua
index e892a5a04..dad96dc06 100644
--- a/xmake/core/base/xmake.lua
+++ b/xmake/core/base/xmake.lua
@@ -37,6 +37,11 @@ function xmake.version()
return xmake._VERSION_CACHE or nil
end
+-- get the xmake binary architecture
+function xmake.arch()
+ return xmake._XMAKE_ARCH
+end
+
-- get the git branch of xmake version, e.g. build: {"dev", "d4cff6e11"}
function xmake.branch()
return xmake.version():build()[1]
diff --git a/xmake/core/sandbox/modules/xmake.lua b/xmake/core/sandbox/modules/xmake.lua
index d4e23984a..f4f36d23c 100644
--- a/xmake/core/sandbox/modules/xmake.lua
+++ b/xmake/core/sandbox/modules/xmake.lua
@@ -25,6 +25,7 @@ local xmake = require("base/xmake")
local sandbox_xmake = sandbox_xmake or {}
-- inherit some builtin interfaces
+sandbox_xmake.arch = xmake.arch
sandbox_xmake.version = xmake.version
sandbox_xmake.branch = xmake.branch
sandbox_xmake.programdir = xmake.programdir